Binder\Binder_Expressions.cs (15)
1713Debug.Assert(SyntaxFacts.IsInvoked(id) == invoked);
2370if (SyntaxFacts.IsName(node.Kind()))
2372if (SyntaxFacts.IsNamespaceAliasQualifier(node))
2376else if (SyntaxFacts.IsInNamespaceOrTypeContext(node))
2381else if (SyntaxFacts.IsTypeSyntax(node.Kind()))
2386return this.BindExpression(node, diagnostics, SyntaxFacts.IsInvoked(node), SyntaxFacts.IsIndexed(node));
6300if (SyntaxFacts.IsAssignmentExpression(elementInitializer.Kind()))
7372Debug.Assert(invoked == SyntaxFacts.IsInvoked(node));
7629diagnostics.Add(ErrorCode.ERR_BadUnaryOp, operatorToken.GetLocation(), SyntaxFacts.GetText(operatorToken.Kind()), leftType);
7636DiagnosticInfo diagnosticInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadOpOnNullOrDefaultOrNew, SyntaxFacts.GetText(operatorToken.Kind()), boundLeft.Display);
7646diagnostics.Add(ErrorCode.ERR_BadUnaryOp, node.Location, SyntaxFacts.GetText(operatorToken.Kind()), msgId.Localize());
8554var isFixedStatementExpression = SyntaxFacts.IsFixedStatementExpression(node);
9807var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
11120DiagnosticInfo diagnosticInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadUnaryOp, SyntaxFacts.GetText(operatorToken.Kind()), msgId.Localize());
Binder\Binder_Operators.cs (5)
2429if (SyntaxFacts.IsCheckedOperator(methodOpt.Name))
2521bool isFixedStatementAddressOfExpression = SyntaxFacts.IsFixedStatementExpression(node);
3182Error(diagnostics, ErrorCode.ERR_BadUnaryOp, node, SyntaxFacts.GetText(SyntaxKind.IsKeyword), operand.Display);
3977Error(diagnostics, ErrorCode.ERR_BadBinaryOps, node, SyntaxFacts.GetText(node.OperatorToken.Kind()), leftOperand.Display, rightOperand.Display);
4235Error(diagnostics, ErrorCode.ERR_BadBinaryOps, node, SyntaxFacts.GetText(node.OperatorToken.Kind()), leftOperand.Display, rightOperand.Display);
Parser\LanguageParser.cs (53)
52return kind == SyntaxKind.IdentifierToken || SyntaxFacts.IsKeywordKind(kind);
1060if (SyntaxFacts.IsLiteralExpression(this.CurrentToken.Kind))
1572if (SyntaxFacts.IsPredefinedType(this.CurrentToken.Kind))
1609return !SyntaxFacts.IsContextualKeyword(nextToken.ContextualKind) && GetModifierExcludingScoped(nextToken) != DeclarationModifiers.None;
2179AddTrailingSkippedSyntax(bounds, this.AddError(separatorToken, ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.CommaToken)));
2251? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken))
3620possibleConversion = !SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(2).Kind);
3624possibleConversion = !SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(1).Kind);
3831if (SyntaxFacts.IsAnyOverloadableOperator(this.CurrentToken.Kind))
3851SyntaxDiagnosticInfo diagInfo = MakeError(opTokenErrorOffset, opTokenErrorWidth, ErrorCode.ERR_BadOperatorSyntax, SyntaxFacts.GetText(SyntaxKind.PlusToken));
3857type = this.AddError(type, ErrorCode.ERR_BadOperatorSyntax, SyntaxFacts.GetText(SyntaxKind.PlusToken));
3898if (opToken.IsMissing || !SyntaxFacts.IsOverloadableUnaryOperator(opKind))
3906if (opToken.IsMissing || !SyntaxFacts.IsOverloadableBinaryOperator(opKind))
3919else if (SyntaxFacts.IsOverloadableBinaryOperator(opKind))
3921opToken = this.AddError(opToken, ErrorCode.ERR_BadBinOpArgs, SyntaxFacts.GetText(opKind));
3923else if (SyntaxFacts.IsOverloadableUnaryOperator(opKind))
3925opToken = this.AddError(opToken, ErrorCode.ERR_BadUnOpArgs, SyntaxFacts.GetText(opKind));
3940SyntaxFacts.IsOverloadableUnaryOperator(opKind) ||
3941SyntaxFacts.IsOverloadableBinaryOperator(opKind)))
4181|| SyntaxFacts.GetAccessorDeclarationKind(this.CurrentToken.ContextualKind) != SyntaxKind.None
4390if (this.IsIncrementalAndFactoryContextMatches && SyntaxFacts.IsAccessorDeclaration(this.CurrentNodeKind))
5267SyntaxFacts.IsBinaryExpressionOperatorToken(currentTokenKind);
5707if (!SyntaxFacts.IsContextualKeyword(((CSharp.Syntax.IdentifierNameSyntax)this.CurrentNode).Identifier.Kind()))
6293var contextualKind = SyntaxFacts.GetContextualKeywordKind(token.ValueText);
7211return SyntaxFacts.IsPredefinedType(keyword);
7465if (SyntaxFacts.IsLiteral(nextTokenKind))
7470if (SyntaxFacts.IsPredefinedType(nextTokenKind))
8180(SyntaxFacts.IsPredefinedType(tk) &&
8338else if (SyntaxFacts.IsPredefinedType(tk))
8566if (SyntaxFacts.GetBaseTypeDeclarationKind(nextToken.Kind) != SyntaxKind.None)
8574if (SyntaxFacts.IsPredefinedType(PeekToken(2).Kind))
9104SyntaxFacts.GetCheckStatement(keyword.Kind),
9332skippedForToken = this.AddError(skippedForToken, ErrorCode.ERR_SyntaxError, SyntaxFacts.GetText(SyntaxKind.ForEachKeyword));
9970SyntaxFacts.IsName(((NullableTypeSyntax)declaration.Type).ElementType.Kind) &&
10666|| SyntaxFacts.IsAnyUnaryExpression(tk)
10667|| (allowBinaryExpressions && SyntaxFacts.IsBinaryExpression(tk))
10668|| (allowAssignmentExpressions && SyntaxFacts.IsAssignmentExpressionOperatorToken(tk));
10884return SyntaxFacts.IsPrefixUnaryExpression(kind) && kind is not SyntaxKind.RefKeyword and not SyntaxKind.OutKeyword;
10889return SyntaxFacts.IsBinaryExpression(kind);
10894return SyntaxFacts.IsAssignmentExpressionOperatorToken(kind);
10984return this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
10994var opKind = SyntaxFacts.GetPrefixUnaryExpression(tk);
11040: this.AddError(result, ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11224return (token1Kind, SyntaxFacts.GetBinaryExpression(token1Kind));
11227return (token1Kind, SyntaxFacts.GetAssignmentExpression(token1Kind));
11553return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken());
11584return this.AddError(_syntaxFactory.RefExpression(refKeyword, this.ParseExpressionCore()), ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11598expr = this.AddError(expr, ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11613expr = this.AddError(expr, ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11643expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken());
12172&& !SyntaxFacts.IsPredefinedType(tk.Kind)
13619fc = this.AddError(fc, ErrorCode.WRN_PrecedenceInversion, SyntaxFacts.GetText(SyntaxKind.FromKeyword));
13686(this.CurrentToken.Kind != SyntaxKind.IdentifierToken || SyntaxFacts.IsQueryContextualKeyword(this.CurrentToken.ContextualKind)))
Symbols\Source\SourcePropertySymbolBase.cs (6)
346{ MethodKind: MethodKind.PropertyGet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.GetKeyword),
347{ MethodKind: MethodKind.PropertySet, IsInitOnly: false } => SyntaxFacts.GetText(SyntaxKind.SetKeyword),
348{ MethodKind: MethodKind.PropertySet, IsInitOnly: true } => SyntaxFacts.GetText(SyntaxKind.InitKeyword),
1097diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.AbstractKeyword));
1102diagnostics.Add(ErrorCode.ERR_BadMemberFlag, location, SyntaxFacts.GetText(SyntaxKind.VirtualKeyword));
1702if (indexerName == null || !SyntaxFacts.IsValidIdentifier(indexerName))