@@ -3341,7 +3341,9 @@ def lookahead_0(self, context: ParserContext, currentToken: Token) -> bool:
33413341 token = None
33423342 queue = []
33433343 match = False
3344- while True :
3344+ # Effectively do-while
3345+ continue_lookahead = True
3346+ while continue_lookahead :
33453347 token = self .read_token (context )
33463348 token .detach ()
33473349 queue .append (token )
@@ -3350,12 +3352,18 @@ def lookahead_0(self, context: ParserContext, currentToken: Token) -> bool:
33503352 match = True
33513353 break
33523354
3355+ continue_lookahead = False
3356+
33533357 if self .match_Empty (context , token ):
3358+ continue_lookahead = True
33543359 continue
33553360 if self .match_Comment (context , token ):
3361+ continue_lookahead = True
33563362 continue
33573363 if self .match_TagLine (context , token ):
3364+ continue_lookahead = True
33583365 continue
3366+
33593367 context .token_queue .extend (queue )
33603368
33613369 return match
@@ -3365,7 +3373,9 @@ def lookahead_1(self, context: ParserContext, currentToken: Token) -> bool:
33653373 token = None
33663374 queue = []
33673375 match = False
3368- while True :
3376+ # Effectively do-while
3377+ continue_lookahead = True
3378+ while continue_lookahead :
33693379 token = self .read_token (context )
33703380 token .detach ()
33713381 queue .append (token )
@@ -3374,12 +3384,18 @@ def lookahead_1(self, context: ParserContext, currentToken: Token) -> bool:
33743384 match = True
33753385 break
33763386
3387+ continue_lookahead = False
3388+
33773389 if self .match_Empty (context , token ):
3390+ continue_lookahead = True
33783391 continue
33793392 if self .match_Comment (context , token ):
3393+ continue_lookahead = True
33803394 continue
33813395 if self .match_TagLine (context , token ):
3396+ continue_lookahead = True
33823397 continue
3398+
33833399 context .token_queue .extend (queue )
33843400
33853401 return match
0 commit comments