Binder\Binder_Expressions.cs (15)
1710Debug.Assert(SyntaxFacts.IsInvoked(id) == invoked);
2367if (SyntaxFacts.IsName(node.Kind()))
2369if (SyntaxFacts.IsNamespaceAliasQualifier(node))
2373else if (SyntaxFacts.IsInNamespaceOrTypeContext(node))
2378else if (SyntaxFacts.IsTypeSyntax(node.Kind()))
2383return this.BindExpression(node, diagnostics, SyntaxFacts.IsInvoked(node), SyntaxFacts.IsIndexed(node));
6297if (SyntaxFacts.IsAssignmentExpression(elementInitializer.Kind()))
7371Debug.Assert(invoked == SyntaxFacts.IsInvoked(node));
7628diagnostics.Add(ErrorCode.ERR_BadUnaryOp, operatorToken.GetLocation(), SyntaxFacts.GetText(operatorToken.Kind()), leftType);
7635DiagnosticInfo diagnosticInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadOpOnNullOrDefaultOrNew, SyntaxFacts.GetText(operatorToken.Kind()), boundLeft.Display);
7645diagnostics.Add(ErrorCode.ERR_BadUnaryOp, node.Location, SyntaxFacts.GetText(operatorToken.Kind()), msgId.Localize());
8553var isFixedStatementExpression = SyntaxFacts.IsFixedStatementExpression(node);
9806var name = candidate.IsIndexer ? SyntaxFacts.GetText(SyntaxKind.ThisKeyword) : candidate.Name;
11119DiagnosticInfo diagnosticInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadUnaryOp, SyntaxFacts.GetText(operatorToken.Kind()), msgId.Localize());
Binder\Binder_Operators.cs (5)
2424if (SyntaxFacts.IsCheckedOperator(methodOpt.Name))
2516bool isFixedStatementAddressOfExpression = SyntaxFacts.IsFixedStatementExpression(node);
3177Error(diagnostics, ErrorCode.ERR_BadUnaryOp, node, SyntaxFacts.GetText(SyntaxKind.IsKeyword), operand.Display);
3972Error(diagnostics, ErrorCode.ERR_BadBinaryOps, node, SyntaxFacts.GetText(node.OperatorToken.Kind()), leftOperand.Display, rightOperand.Display);
4230Error(diagnostics, ErrorCode.ERR_BadBinaryOps, node, SyntaxFacts.GetText(node.OperatorToken.Kind()), leftOperand.Display, rightOperand.Display);
Parser\LanguageParser.cs (53)
51return kind == SyntaxKind.IdentifierToken || SyntaxFacts.IsKeywordKind(kind);
1059if (SyntaxFacts.IsLiteralExpression(this.CurrentToken.Kind))
1571if (SyntaxFacts.IsPredefinedType(this.CurrentToken.Kind))
1608return !SyntaxFacts.IsContextualKeyword(nextToken.ContextualKind) && GetModifierExcludingScoped(nextToken) != DeclarationModifiers.None;
2160AddTrailingSkippedSyntax(bounds, this.AddError(separatorToken, ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.CommaToken)));
2232? this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedToken, SyntaxFacts.GetText(SyntaxKind.QuestionToken))
3601possibleConversion = !SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(2).Kind);
3605possibleConversion = !SyntaxFacts.IsAnyOverloadableOperator(this.PeekToken(1).Kind);
3812if (SyntaxFacts.IsAnyOverloadableOperator(this.CurrentToken.Kind))
3832SyntaxDiagnosticInfo diagInfo = MakeError(opTokenErrorOffset, opTokenErrorWidth, ErrorCode.ERR_BadOperatorSyntax, SyntaxFacts.GetText(SyntaxKind.PlusToken));
3838type = this.AddError(type, ErrorCode.ERR_BadOperatorSyntax, SyntaxFacts.GetText(SyntaxKind.PlusToken));
3879if (opToken.IsMissing || !SyntaxFacts.IsOverloadableUnaryOperator(opKind))
3887if (opToken.IsMissing || !SyntaxFacts.IsOverloadableBinaryOperator(opKind))
3900else if (SyntaxFacts.IsOverloadableBinaryOperator(opKind))
3902opToken = this.AddError(opToken, ErrorCode.ERR_BadBinOpArgs, SyntaxFacts.GetText(opKind));
3904else if (SyntaxFacts.IsOverloadableUnaryOperator(opKind))
3906opToken = this.AddError(opToken, ErrorCode.ERR_BadUnOpArgs, SyntaxFacts.GetText(opKind));
3921SyntaxFacts.IsOverloadableUnaryOperator(opKind) ||
3922SyntaxFacts.IsOverloadableBinaryOperator(opKind)))
4162|| SyntaxFacts.GetAccessorDeclarationKind(this.CurrentToken.ContextualKind) != SyntaxKind.None
4371if (this.IsIncrementalAndFactoryContextMatches && SyntaxFacts.IsAccessorDeclaration(this.CurrentNodeKind))
5224SyntaxFacts.IsBinaryExpressionOperatorToken(currentTokenKind);
5664if (!SyntaxFacts.IsContextualKeyword(((CSharp.Syntax.IdentifierNameSyntax)this.CurrentNode).Identifier.Kind()))
6241var contextualKind = SyntaxFacts.GetContextualKeywordKind(token.ValueText);
7159return SyntaxFacts.IsPredefinedType(keyword);
7413if (SyntaxFacts.IsLiteral(nextTokenKind))
7418if (SyntaxFacts.IsPredefinedType(nextTokenKind))
8128(SyntaxFacts.IsPredefinedType(tk) &&
8286else if (SyntaxFacts.IsPredefinedType(tk))
8514if (SyntaxFacts.GetBaseTypeDeclarationKind(nextToken.Kind) != SyntaxKind.None)
8522if (SyntaxFacts.IsPredefinedType(PeekToken(2).Kind))
9052SyntaxFacts.GetCheckStatement(keyword.Kind),
9280skippedForToken = this.AddError(skippedForToken, ErrorCode.ERR_SyntaxError, SyntaxFacts.GetText(SyntaxKind.ForEachKeyword));
9919SyntaxFacts.IsName(((NullableTypeSyntax)declaration.Type).ElementType.Kind) &&
10600|| SyntaxFacts.IsAnyUnaryExpression(tk)
10601|| (allowBinaryExpressions && SyntaxFacts.IsBinaryExpression(tk))
10602|| (allowAssignmentExpressions && SyntaxFacts.IsAssignmentExpressionOperatorToken(tk));
10818return SyntaxFacts.IsPrefixUnaryExpression(kind) && kind is not SyntaxKind.RefKeyword and not SyntaxKind.OutKeyword;
10823return SyntaxFacts.IsBinaryExpression(kind);
10828return SyntaxFacts.IsAssignmentExpressionOperatorToken(kind);
10918return this.AddError(this.CreateMissingIdentifierName(), ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
10928var opKind = SyntaxFacts.GetPrefixUnaryExpression(tk);
10974: this.AddError(result, ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11158return (token1Kind, SyntaxFacts.GetBinaryExpression(token1Kind));
11161return (token1Kind, SyntaxFacts.GetAssignmentExpression(token1Kind));
11487return _syntaxFactory.LiteralExpression(SyntaxFacts.GetLiteralExpression(tk), this.EatToken());
11518return this.AddError(_syntaxFactory.RefExpression(refKeyword, this.ParseExpressionCore()), ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11532expr = this.AddError(expr, ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11547expr = this.AddError(expr, ErrorCode.ERR_InvalidExprTerm, SyntaxFacts.GetText(tk));
11577expr = _syntaxFactory.PostfixUnaryExpression(SyntaxFacts.GetPostfixUnaryExpression(this.CurrentToken.Kind), expr, this.EatToken());
12106&& !SyntaxFacts.IsPredefinedType(tk.Kind)
13553fc = this.AddError(fc, ErrorCode.WRN_PrecedenceInversion, SyntaxFacts.GetText(SyntaxKind.FromKeyword));
13620(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));
1697if (indexerName == null || !SyntaxFacts.IsValidIdentifier(indexerName))