102 references to AddError
Microsoft.CodeAnalysis.CSharp (102)
Parser\DirectiveParser.cs (33)
116
hash = this.
AddError
(hash, ErrorCode.ERR_BadDirectivePlacement);
131
id = this.
AddError
(id, ErrorCode.ERR_PPDirectiveExpected);
135
hash = this.
AddError
(hash, ErrorCode.ERR_PPDirectiveExpected);
171
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected);
175
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected);
179
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective);
194
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected);
198
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected);
202
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective);
217
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndRegionDirectiveExpected);
221
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective);
239
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_EndifDirectiveExpected);
243
return this.
AddError
(SyntaxFactory.BadDirectiveTrivia(hash, keyword, eod, isActive), ErrorCode.ERR_UnexpectedDirective);
251
keyword = this.
AddError
(keyword, ErrorCode.ERR_PPDefFollowsToken);
389
line = this.
AddError
(line, ErrorCode.ERR_InvalidLineNumber);
393
line = this.
AddError
(line, ErrorCode.WRN_TooManyLinesForDebugger);
419
start = this.
AddError
(start, ErrorCode.ERR_LineSpanDirectiveRequiresSpace);
429
end = this.
AddError
(end, ErrorCode.ERR_LineSpanDirectiveEndLessThanStart);
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 (67)
256
namespaceToken = this.
AddError
(namespaceToken, ErrorCode.ERR_NamespaceNotAllowedInScript);
527
:
AddError
(
616
token = this.
AddError
(token,
733
skippedToken = this.
AddError
(skippedToken,
783
memberOrStatement = this.
AddError
(memberOrStatement, ErrorCode.ERR_TopLevelStatementAfterNamespaceOrType);
828
@using = this.
AddError
(@using, ErrorCode.ERR_UsingAfterElements);
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),
2178
? this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected)
2188
bounds.Add(_syntaxFactory.TypeConstraint(this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected)));
2220
bounds.Add(_syntaxFactory.TypeConstraint(this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_TypeExpected)));
2299
this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoEnumConstraint),
2308
this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_NoDelegateConstraint),
2620
this.
AddError
(SyntaxFactory.MissingToken(SyntaxKind.VoidKeyword), ErrorCode.ERR_MemberNeedsType));
3704
type = this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected);
3801
separator = this.
AddError
(separator, ErrorCode.ERR_AliasQualAsExpression);
3834
var misplacedToken = this.
AddError
(this.EatToken(), ErrorCode.ERR_MisplacedUnchecked);
4010
opToken = this.
AddError
(opToken, ErrorCode.ERR_OvlOperatorExpected);
4056
thisKeyword = this.
AddError
(thisKeyword, ErrorCode.ERR_UnexpectedGenericName);
4114
identifier = this.
AddError
(identifier, ErrorCode.ERR_UnexpectedGenericName);
4500
accessorName = this.
AddError
(accessorName,
4800
identifier = allowOptionalIdentifier ? null : this.
AddError
(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected);
4814
this.
AddError
(this.EatToken(), ErrorCode.ERR_BadArraySyntax),
4970
identifier = this.
AddError
(identifier, ErrorCode.ERR_IdentifierExpected);
4976
identifier = this.
AddError
(identifier, ErrorCode.ERR_UnexpectedGenericName);
5012
semi = this.
AddError
(semi, ErrorCode.ERR_UnexpectedSemicolon);
5065
eventToken = this.
AddError
(eventToken, ErrorCode.ERR_ExplicitEventFieldImpl);
5414
name = this.
AddError
(name, ErrorCode.ERR_MultiTypeInDeclaration);
5464
argumentList = this.
AddError
(argumentList, ErrorCode.ERR_BadVarDecl);
5477
close = this.
AddError
(close, ErrorCode.ERR_ValueExpected);
5489
expression = this.
AddError
(expression, ErrorCode.ERR_ArraySizeInDeclaration);
5503
argumentList = this.
AddError
(argumentList, ErrorCode.ERR_CStyleArray);
5516
name = this.
AddError
(name, ErrorCode.ERR_ConstValueRequired); // Error here for missing constant initializers
5523
name = this.
AddError
(name, ErrorCode.ERR_FixedDimsRequired);
5642
name = this.
AddError
(name, ErrorCode.ERR_UnexpectedGenericName);
5842
identifierToken = this.
AddError
(identifierToken, ErrorCode.ERR_BadAwaitAsIdentifier);
5849
return this.
AddError
(CreateMissingIdentifierToken(), code);
5939
this.
AddError
(CreateMissingIdentifierToken(), ErrorCode.ERR_IdentifierExpected));
6477
? this.
AddError
(this.EatToken(), ErrorCode.ERR_IllegalVarianceSyntax)
6518
result = this.
AddError
(result, ErrorCode.ERR_TypeExpected);
6595
separator = this.
AddError
(separator, ErrorCode.ERR_AliasQualAsExpression);
6649
AddError
(separator, ErrorCode.ERR_ExplicitEventFieldImpl));
6705
separator = this.
AddError
(separator, ErrorCode.ERR_UnexpectedAliasedName);
6769
separator = this.
AddError
(separator, ErrorCode.ERR_AliasQualAsExpression);
6847
separator = this.
AddError
(separator, ErrorCode.ERR_UnexpectedAliasedName);
7729
var missing = this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements);
7762
token = this.
AddError
(token, mode == ParseTypeMode.Parameter ? ErrorCode.ERR_NoVoidParameter : ErrorCode.ERR_NoVoidHere);
7783
return this.
AddError
(
7939
unmanagedCallingConventions =
AddError
(unmanagedCallingConventions, ErrorCode.ERR_CannotSpecifyManagedWithUnmanagedSpecifiers);
8791
? this.
AddError
(
9041
semicolonToken = this.
AddError
(semicolonToken, ErrorCode.ERR_SemicolonExpected);
9478
@in = this.
AddError
(@in, ErrorCode.ERR_BadForeachDecl);
9828
returnOrBreak = this.
AddError
(returnOrBreak, ErrorCode.ERR_EmptyYield);
9906
expression = this.
AddError
(expression, ErrorCode.ERR_SwitchGoverningExpressionRequiresParens);
9952
node = this.
AddError
(node, ErrorCode.ERR_DiscardPatternInSwitchStatement);
10465
type = this.
AddError
(type, ErrorCode.ERR_NoVoidHere);
10506
mod = this.
AddError
(mod, ErrorCode.ERR_NoModifiersOnUsing);
10515
mod = this.
AddError
(mod, ErrorCode.ERR_TypeExpected);
11373
return this.
AddError
(conditionalExpression, ErrorCode.ERR_ConditionalInInterpolation);
11779
expr = this.
AddError
(expr, ErrorCode.ERR_ExpressionExpected);
11823
this.ConvertToMissingWithTrailingTrivia(this.
AddError
(this.EatToken(), ErrorCode.ERR_UnexpectedAliasedName), SyntaxKind.DotToken),
11854
this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_IdentifierExpected));
12561
this.
AddError
(this.CreateMissingIdentifierName(), ErrorCode.ERR_TupleTooFewElements)));
13248
var size = this.
AddError
(this.ParseExpressionCore(), ErrorCode.ERR_InvalidArray);
13322
var size = this.
AddError
(this.ParseExpressionCore(), ErrorCode.ERR_InvalidStackAllocArray);
13328
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);