Skip to content

Commit 6eaa635

Browse files
committed
skip alternation (|) tokens
1 parent bcfc5c3 commit 6eaa635

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Type/Regex/RegexGroupParser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ private function createGroupType(TreeNode $group, bool $maybeConstant, string $p
286286
if ($rootAlternation !== null) {
287287
$types = [];
288288
foreach ($rootAlternation->getChildren() as $alternative) {
289+
if ($alternative->getValueToken() === 'alternation') {
290+
continue;
291+
}
292+
289293
$types[] = $this->createGroupType($alternative, $maybeConstant, $patternModifiers);
290294
}
291295

0 commit comments

Comments
 (0)