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