65 references to AddError
Microsoft.CodeAnalysis.CSharp (65)
Parser\DirectiveParser.cs (21)
116
hash = this.
AddError
(hash, ErrorCode.ERR_BadDirectivePlacement);
131
id = this.
AddError
(id, ErrorCode.ERR_PPDirectiveExpected);
135
hash = this.
AddError
(hash, ErrorCode.ERR_PPDirectiveExpected);
251
keyword = this.
AddError
(keyword, ErrorCode.ERR_PPDefFollowsToken);
389
line = this.
AddError
(line, ErrorCode.ERR_InvalidLineNumber);
393
line = this.
AddError
(line, ErrorCode.WRN_TooManyLinesForDebugger);
438
characterOffset = this.
AddError
(characterOffset, ErrorCode.ERR_LineSpanDirectiveRequiresSpace);
446
file = this.
AddError
(file, ErrorCode.ERR_LineSpanDirectiveRequiresSpace);
491
token = this.
AddError
(token, ErrorCode.ERR_LineSpanDirectiveInvalidValue);
504
keyword = this.
AddError
(keyword, ErrorCode.ERR_ReferenceDirectiveOnlyAllowedInScripts);
508
keyword = this.
AddError
(keyword, ErrorCode.ERR_PPReferenceFollowsToken);
524
keyword = this.
AddError
(keyword, ErrorCode.ERR_LoadDirectiveOnlyAllowedInScripts);
528
keyword = this.
AddError
(keyword, ErrorCode.ERR_PPLoadFollowsToken);
649
guid = this.
AddError
(guid, ErrorCode.WRN_IllegalPPChecksum);
658
bytes = this.
AddError
(bytes, ErrorCode.WRN_IllegalPPChecksum);
666
bytes = this.
AddError
(bytes, ErrorCode.WRN_IllegalPPChecksum);
690
exclamation = this.
AddError
(exclamation, ErrorCode.ERR_PPShebangInProjectBasedProgram);
702
colon = this.
AddError
(colon, ErrorCode.ERR_PPIgnoredNeedsFileBasedProgram);
707
colon = this.
AddError
(colon, ErrorCode.ERR_PPIgnoredFollowsToken);
712
colon = this.
AddError
(colon, ErrorCode.ERR_PPIgnoredFollowsIf);
745
skippedTokens.Add(this.
AddError
(this.EatToken().WithoutDiagnosticsGreen(), errorCode));
Parser\LanguageParser.cs (42)
256
namespaceToken = this.
AddError
(namespaceToken, ErrorCode.ERR_NamespaceNotAllowedInScript);
527
:
AddError
(
616
token = this.
AddError
(token,
733
skippedToken = this.
AddError
(skippedToken,
971
unsafeToken = AddTrailingSkippedSyntax(unsafeToken,
AddError
(this.EatToken(), ErrorCode.ERR_BadStaticAfterUnsafe));
1745
keyword = AddTrailingSkippedSyntax(keyword, this.
AddError
(this.EatToken(), ErrorCode.ERR_ExtensionDisallowsName));
1887
this.
AddError
(ConvertToKeyword(this.EatToken()), ErrorCode.ERR_MisplacedRecord),
2620
this.
AddError
(SyntaxFactory.MissingToken(SyntaxKind.VoidKeyword), ErrorCode.ERR_MemberNeedsType));
3799
separator = this.
AddError
(separator, ErrorCode.ERR_AliasQualAsExpression);
3832
var misplacedToken = this.
AddError
(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked);
4008
opToken = this.
AddError
(opToken, ErrorCode.ERR_OvlOperatorExpected);
4054
thisKeyword = this.
AddError
(thisKeyword, ErrorCode.ERR_UnexpectedGenericName);
4112
identifier = this.
AddError
(identifier, ErrorCode.ERR_UnexpectedGenericName);
4498
accessorName = this.
AddError
(accessorName,
4798
identifier = allowOptionalIdentifier ? null : this.
AddError
(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected);
4812
this.
AddError
(this.EatToken(), ErrorCode.ERR_BadArraySyntax),
4968
identifier = this.
AddError
(identifier, ErrorCode.ERR_IdentifierExpected);
4974
identifier = this.
AddError
(identifier, ErrorCode.ERR_UnexpectedGenericName);
5010
semi = this.
AddError
(semi, ErrorCode.ERR_UnexpectedSemicolon);
5063
eventToken = this.
AddError
(eventToken, ErrorCode.ERR_ExplicitEventFieldImpl);
5412
name = this.
AddError
(name, ErrorCode.ERR_MultiTypeInDeclaration);
5514
name = this.
AddError
(name, ErrorCode.ERR_ConstValueRequired); // Error here for missing constant initializers
5521
name = this.
AddError
(name, ErrorCode.ERR_FixedDimsRequired);
5640
name = this.
AddError
(name, ErrorCode.ERR_UnexpectedGenericName);
5840
identifierToken = this.
AddError
(identifierToken, ErrorCode.ERR_BadAwaitAsIdentifier);
5847
return this.
AddError
(CreateMissingIdentifierToken(), code);
5937
this.
AddError
(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected));
6475
? this.
AddError
(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax)
6593
separator = this.
AddError
(separator, ErrorCode.ERR_AliasQualAsExpression);
6647
AddError
(separator, ErrorCode.ERR_ExplicitEventFieldImpl));
6703
separator = this.
AddError
(separator, ErrorCode.ERR_UnexpectedAliasedName);
6767
separator = this.
AddError
(separator, ErrorCode.ERR_AliasQualAsExpression);
6845
separator = this.
AddError
(separator, ErrorCode.ERR_UnexpectedAliasedName);
7760
token = this.
AddError
(token, mode == ParseTypeMode.Parameter ? ErrorCode.ERR_NoVoidParameter : ErrorCode.ERR_NoVoidHere);
8778
? this.
AddError
(
9447
@in = this.
AddError
(@in, ErrorCode.ERR_BadForeachDecl);
9797
returnOrBreak = this.
AddError
(returnOrBreak, ErrorCode.ERR_EmptyYield);
9921
node = this.
AddError
(node, ErrorCode.ERR_DiscardPatternInSwitchStatement);
10475
mod = this.
AddError
(mod, ErrorCode.ERR_NoModifiersOnUsing);
10484
mod = this.
AddError
(mod, ErrorCode.ERR_TypeExpected);
11792
this.ConvertToMissingWithTrailingTrivia(this.
AddError
(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken),
13297
var comma = this.
AddError
(this.EatToken(), ErrorCode.ERR_InvalidStackAllocArray);
Parser\LanguageParser_Patterns.cs (1)
591
?
AddError
(this.EatToken(), ErrorCode.ERR_BadCaseInSwitchArm)
Parser\SyntaxParser.cs (1)
570
token =
AddError
(token, code);