43 references to ParseNextToken
Microsoft.CodeAnalysis.CSharp (2)
Syntax\SyntaxTokenParser.cs (2)
14
/// <see cref="
ParseNextToken
"/> will return the next token in the source text, starting from position 0. <see cref="SkipForwardTo(int)"/>
112
/// The result of a call to <see cref="
ParseNextToken
"/>. This is also a context object that can be used to reset the parser to
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (41)
LexicalAndXml\SyntaxTokenParserTests.cs (41)
22
Assert.Throws<NullReferenceException>(() => parser.
ParseNextToken
());
42
""", parser.
ParseNextToken
());
47
""", parser.
ParseNextToken
());
52
""", parser.
ParseNextToken
());
57
""", parser.
ParseNextToken
());
59
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.None, new TextSpan(31, 0), "", parser.
ParseNextToken
());
60
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.None, new TextSpan(31, 0), "", parser.
ParseNextToken
());
77
var result = parser.
ParseNextToken
();
92
""", parser.
ParseNextToken
());
97
""", parser.
ParseNextToken
());
102
""", parser.
ParseNextToken
());
104
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.None, new TextSpan(63, 0), "", parser.
ParseNextToken
());
124
""", parser.
ParseNextToken
());
129
""", parser.
ParseNextToken
());
134
""", parser.
ParseNextToken
());
141
""", parser.
ParseNextToken
());
143
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.None, new TextSpan(40, 0), "", parser.
ParseNextToken
());
165
""", parser.
ParseNextToken
());
172
""", parser.
ParseNextToken
());
177
""", parser.
ParseNextToken
());
187
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.None, new TextSpan(1, 4), """lass""", parser.
ParseNextToken
());
196
AssertToken(expectedKind: SyntaxKind.EndOfFileToken, expectedContextualKind: SyntaxKind.None, new TextSpan(100, 0), "", parser.
ParseNextToken
());
205
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 6), "class ", parser.
ParseNextToken
());
226
""", parser.
ParseNextToken
());
228
SyntaxTokenParser.Result cTokenResult = parser.
ParseNextToken
();
238
Assert.Equal(cTokenResult, parser.
ParseNextToken
());
247
""", parser.
ParseNextToken
());
254
""", parser.
ParseNextToken
());
264
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.WhenKeyword, new TextSpan(0, 5), "when ", parser.
ParseNextToken
());
265
AssertToken(expectedKind: SyntaxKind.IdentifierToken, expectedContextualKind: SyntaxKind.None, new TextSpan(5, 11), "identifier ", parser.
ParseNextToken
());
266
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(16, 5), "class", parser.
ParseNextToken
());
285
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 6), "class ", parser.
ParseNextToken
());
311
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(11, 6), "class ", parser.
ParseNextToken
());
314
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 17), "/* test */ class ", parser.
ParseNextToken
());
345
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(14, 6), "class ", parser.
ParseNextToken
());
348
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 20), "/* test */\r\n\r\nclass ", parser.
ParseNextToken
());
362
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 6), "class ", parser.
ParseNextToken
());
378
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(11, 6), "class ", parser.
ParseNextToken
());
381
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 17), "/* test */ class ", parser.
ParseNextToken
());
401
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(12, 8), "\r\nclass ", parser.
ParseNextToken
());
404
AssertToken(expectedKind: SyntaxKind.ClassKeyword, expectedContextualKind: SyntaxKind.None, new TextSpan(0, 20), "/* test */\r\n\r\nclass ", parser.
ParseNextToken
());