68 references to AddError
Microsoft.CodeAnalysis.CSharp (68)
Parser\DirectiveParser.cs (21)
116hash = this.AddError(hash, ErrorCode.ERR_BadDirectivePlacement); 131id = this.AddError(id, ErrorCode.ERR_PPDirectiveExpected); 135hash = this.AddError(hash, ErrorCode.ERR_PPDirectiveExpected); 251keyword = this.AddError(keyword, ErrorCode.ERR_PPDefFollowsToken); 390line = this.AddError(line, ErrorCode.ERR_InvalidLineNumber); 394line = this.AddError(line, ErrorCode.WRN_TooManyLinesForDebugger); 439characterOffset = this.AddError(characterOffset, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 447file = this.AddError(file, ErrorCode.ERR_LineSpanDirectiveRequiresSpace); 492token = this.AddError(token, ErrorCode.ERR_LineSpanDirectiveInvalidValue); 505keyword = this.AddError(keyword, ErrorCode.ERR_ReferenceDirectiveOnlyAllowedInScripts); 509keyword = this.AddError(keyword, ErrorCode.ERR_PPReferenceFollowsToken); 525keyword = this.AddError(keyword, ErrorCode.ERR_LoadDirectiveOnlyAllowedInScripts); 529keyword = this.AddError(keyword, ErrorCode.ERR_PPLoadFollowsToken); 650guid = this.AddError(guid, ErrorCode.WRN_IllegalPPChecksum); 659bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 667bytes = this.AddError(bytes, ErrorCode.WRN_IllegalPPChecksum); 691exclamation = this.AddError(exclamation, ErrorCode.ERR_PPShebangInProjectBasedProgram); 703colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredNeedsFileBasedProgram); 708colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredFollowsToken); 713colon = this.AddError(colon, ErrorCode.ERR_PPIgnoredFollowsIf); 746skippedTokens.Add(this.AddError(this.EatToken().WithoutDiagnosticsGreen(), errorCode));
Parser\LanguageParser.cs (42)
256namespaceToken = this.AddError(namespaceToken, ErrorCode.ERR_NamespaceNotAllowedInScript); 527: AddError( 616token = this.AddError(token, 741skippedToken = this.AddError(skippedToken, 980unsafeToken = AddTrailingSkippedSyntax(unsafeToken, AddError(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe)); 1779keyword = AddTrailingSkippedSyntax(keyword, this.AddError(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName)); 1915this.AddError(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord), 2655this.AddError(SyntaxFactory.MissingToken(SyntaxKind.VoidKeyword), ErrorCode.ERR_MemberNeedsType)); 3158identifierOrThisOpt ??= this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected); 3925separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 3958var misplacedToken = this.AddError(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked); 4134opToken = this.AddError(opToken, ErrorCode.ERR_OvlOperatorExpected); 4180thisKeyword = this.AddError(thisKeyword, ErrorCode.ERR_UnexpectedGenericName); 4238identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 4653accessorName = this.AddError(accessorName, 4954identifier = identifierIsOptional ? null : this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected); 4968this.AddError(this.EatToken(), ErrorCode.ERR_BadArraySyntax), 5142identifier = this.AddError(identifier, ErrorCode.ERR_IdentifierExpected); 5148identifier = this.AddError(identifier, ErrorCode.ERR_UnexpectedGenericName); 5184semi = this.AddError(semi, ErrorCode.ERR_UnexpectedSemicolon); 5237eventToken = this.AddError(eventToken, ErrorCode.ERR_ExplicitEventFieldImpl); 5587name = this.AddError(name, ErrorCode.ERR_MultiTypeInDeclaration); 5709name = this.AddError(name, ErrorCode.ERR_ConstValueRequired); // Error here for missing constant initializers 5716name = this.AddError(name, ErrorCode.ERR_FixedDimsRequired); 5876name = this.AddError(name, ErrorCode.ERR_UnexpectedGenericName); 6076identifierToken = this.AddError(identifierToken, ErrorCode.ERR_BadAwaitAsIdentifier); 6083return this.AddError(CreateMissingIdentifierToken(), code); 6180this.AddError(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected)); 6709? this.AddError(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax) 6827separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 6881AddError(separator, ErrorCode.ERR_ExplicitEventFieldImpl)); 6937separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 7001separator = this.AddError(separator, ErrorCode.ERR_AliasQualAsExpression); 7079separator = this.AddError(separator, ErrorCode.ERR_UnexpectedAliasedName); 7990token = this.AddError(token, mode == ParseTypeMode.Parameter ? ErrorCode.ERR_NoVoidParameter : ErrorCode.ERR_NoVoidHere); 9068? this.AddError( 9755@in = this.AddError(@in, ErrorCode.ERR_BadForeachDecl); 10138returnOrBreak = this.AddError(returnOrBreak, ErrorCode.ERR_EmptyYield); 10262node = this.AddError(node, ErrorCode.ERR_DiscardPatternInSwitchStatement); 10818mod = this.AddError(mod, ErrorCode.ERR_NoModifiersOnUsing); 12147this.ConvertToMissingWithTrailingTrivia(this.AddError(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken), 13686var comma = this.AddError(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray);
Parser\LanguageParser_Patterns.cs (4)
169skippedSyntax: AddError(this.EatToken(), ErrorCode.ERR_EqualityOperatorInPatternNotSupported), 178this.AddError(this.EatToken(), ErrorCode.ERR_InequalityOperatorInPatternNotSupported)), 380? AddError(this.EatToken(), ErrorCode.ERR_DesignatorBeforePropertyPattern) 616? AddError(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (1)
564token = AddError(token, code);