@@ -323,9 +323,7 @@ private function parseConditional(TokenIterator $tokens, Ast\Type\TypeNode $subj
323
323
324
324
$ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL );
325
325
$ tokens ->consumeTokenType (Lexer::TOKEN_NULLABLE );
326
- while ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL )) {
327
- continue ;
328
- }
326
+ $ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL , true );
329
327
330
328
$ ifType = $ this ->parse ($ tokens );
331
329
@@ -413,9 +411,7 @@ public function isHtml(TokenIterator $tokens): bool
413
411
public function parseGeneric (TokenIterator $ tokens , Ast \Type \IdentifierTypeNode $ baseType ): Ast \Type \GenericTypeNode
414
412
{
415
413
$ tokens ->consumeTokenType (Lexer::TOKEN_OPEN_ANGLE_BRACKET );
416
- while ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL )) {
417
- continue ;
418
- }
414
+ $ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL , true );
419
415
420
416
$ genericTypes = [];
421
417
$ variances = [];
@@ -808,9 +804,7 @@ private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShape
808
804
$ startIndex = $ tokens ->currentTokenIndex ();
809
805
810
806
// parse any comments above the item
811
- while ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL )) {
812
- continue ;
813
- }
807
+ $ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL , true );
814
808
815
809
try {
816
810
$ tokens ->pushSavePoint ();
@@ -916,9 +910,7 @@ private function parseObjectShapeItem(TokenIterator $tokens): Ast\Type\ObjectSha
916
910
$ startLine = $ tokens ->currentTokenLine ();
917
911
$ startIndex = $ tokens ->currentTokenIndex ();
918
912
919
- while ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL )) {
920
- continue ;
921
- }
913
+ $ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL , true );
922
914
923
915
$ key = $ this ->parseObjectShapeKey ($ tokens );
924
916
$ optional = $ tokens ->tryConsumeTokenType (Lexer::TOKEN_NULLABLE );
0 commit comments