Skip to content

Commit 768b20d

Browse files
committed
Make NFA builder cope with <before>.
Also, with <before('x')>. Both caused it to explode unhelpfully before, with no indication of where things went wrong.
1 parent e423c36 commit 768b20d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/QRegex/NFA.nqp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ class QRegex::NFA {
333333
my $indent := dentin();
334334
my $subtype := $node.subtype;
335335
note("$indent subrule $from -> $to {$node.name}") if $nfadeb;
336-
if $node.name eq 'before' && !$node.negate {
336+
if $node.name eq 'before' && !$node.negate &&
337+
nqp::istype((try $node[0][1].ann('orig_qast')), QAST::Regex) {
337338
my int $end := self.addstate();
338339
self.regex_nfa($node[0][1].ann('orig_qast'), $from, $end);
339340
dentout(self.fate($node, $end, $to));

0 commit comments

Comments
 (0)