File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using SqlServerSimulator . Parser . Tokens ;
22using System . Collections . Frozen ;
33using System . Data . Common ;
4+ using System . Diagnostics . CodeAnalysis ;
45
56namespace SqlServerSimulator . Parser ;
67
@@ -80,7 +81,7 @@ public void MoveNextOptional()
8081 public Token GetNextRequired ( )
8182 {
8283 var previous = this . Token ;
83- return MoveNext ( ) ? this . Token ! : throw SimulatedSqlException . SyntaxErrorNear ( previous ) ;
84+ return MoveNext ( ) ? this . Token : throw SimulatedSqlException . SyntaxErrorNear ( previous ) ;
8485 }
8586
8687 /// <summary>
@@ -131,7 +132,8 @@ public void MoveNextRequired()
131132 /// <see cref="index"/> is updated to the position of the next token.
132133 /// </remarks>
133134 /// <returns>True if another token was found, otherwise false.</returns>
134- private bool MoveNext ( )
135+ [ MemberNotNullWhen ( true , nameof ( Token ) ) ]
136+ public bool MoveNext ( )
135137 {
136138 while ( Tokenizer . NextToken ( commandText , ref index ) is Token token )
137139 {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ internal IEnumerable<SimulatedStatementOutcome> CreateResultSetsForCommand(Simul
3232 {
3333 var context = new ParserContext ( command ) ;
3434
35- while ( context . GetNextOptional ( ) is not null )
35+ while ( context . MoveNext ( ) )
3636 {
3737 switch ( context . Token )
3838 {
@@ -166,7 +166,7 @@ internal IEnumerable<SimulatedStatementOutcome> CreateResultSetsForCommand(Simul
166166 }
167167
168168 throw SimulatedSqlException . SyntaxErrorNear ( context ) ;
169- } // while (tokens.TryMoveNext(out var token))
169+ }
170170 }
171171
172172 private static bool TryParseSet ( ParserContext context )
You can’t perform that action at this time.
0 commit comments