@@ -378,7 +378,7 @@ private function walkGroupAst(
378
378
$ meaningfulTokens = 0 ;
379
379
foreach ($ children as $ child ) {
380
380
$ nonFalsy = false ;
381
- if (! $ this ->isNonEmptyNode ($ child , $ patternModifiers , $ nonFalsy )) {
381
+ if ($ this ->isEmptyNode ($ child , $ patternModifiers , $ nonFalsy )) {
382
382
continue ;
383
383
}
384
384
@@ -426,11 +426,6 @@ private function walkGroupAst(
426
426
}
427
427
}
428
428
$ onlyLiterals = $ newLiterals ;
429
-
430
- if (!$ inOptionalQuantification ) {
431
- $ isNonEmpty = TrinaryLogic::createYes ();
432
- }
433
-
434
429
} elseif ($ ast ->getId () === 'token ' ) {
435
430
$ literalValue = $ this ->getLiteralValue ($ ast , $ onlyLiterals , !$ inClass , $ patternModifiers );
436
431
if ($ literalValue !== null ) {
@@ -476,7 +471,7 @@ private function walkGroupAst(
476
471
}
477
472
}
478
473
479
- private function isNonEmptyNode (TreeNode $ node , string $ patternModifiers , bool &$ isNonFalsy ): bool
474
+ private function isEmptyNode (TreeNode $ node , string $ patternModifiers , bool &$ isNonFalsy ): bool
480
475
{
481
476
if ($ node ->getId () === '#quantification ' ) {
482
477
[$ min ] = $ this ->getQuantificationRange ($ node );
@@ -499,7 +494,7 @@ private function isNonEmptyNode(TreeNode $node, string $patternModifiers, bool &
499
494
}
500
495
501
496
foreach ($ node ->getChildren () as $ child ) {
502
- if ($ this ->isNonEmptyNode ($ child , $ patternModifiers , $ isNonFalsy )) {
497
+ if ($ this ->isEmptyNode ($ child , $ patternModifiers , $ isNonFalsy )) {
503
498
return true ;
504
499
}
505
500
}
0 commit comments