Here are the examples of the csharp api System.Collections.Generic.IEnumerable.Contains(TokenKind) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
19
Source : LineFormatter.cs
with Apache License 2.0
from microsoft
with Apache License 2.0
from microsoft
private bool Is(params TokenKind[] kinds) => kinds.Contains(Kind);
19
Source : Parser.cs
with MIT License
from sb
with MIT License
from sb
private StatementBlockSyntax ParseStatementsExcept(params TokenKind[] kinds)
{
List<BaseStatementSyntax> statements = new List<BaseStatementSyntax>();
while (this.index < this.tokens.Count && !kinds.Contains(this.Peek()))
{
statements.Add(this.ParseStatement());
}
return new StatementBlockSyntax(statements);
}
19
Source : Parser.cs
with Apache License 2.0
from wixette
with Apache License 2.0
from wixette
private SyntaxNode ParseStatementsExcept(params TokenKind[] kinds)
{
var children = new List<SyntaxNode>();
while (this.index < this.tokens.Count && !kinds.Contains(this.Peek()))
{
children.Add(this.ParseStatement());
}
return children.Count > 0 ?
SyntaxNode.CreateNonTerminal(SyntaxNodeKind.StatementBlockSyntax, children) :
SyntaxNode.CreateEmpty();
}