Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle empty concat nodes in NFA builder; fixes tests we regressed in…
… the protoregexes branch.
  • Loading branch information
jnthn committed Nov 16, 2011
1 parent ad45f01 commit 0bbd9c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/QRegex/NFA.nqp
Expand Up @@ -87,7 +87,7 @@ class QRegex::NFA {
$from := self.regex_nfa($node[$i], $from, -1);
$i := $i + 1;
}
$from > 0 ?? self.regex_nfa($node[$i], $from, $to) !! $to;
$from > 0 && $n >= 0 ?? self.regex_nfa($node[$i], $from, $to) !! $to;
}

method enumcharlist($node, $from, $to) {
Expand Down Expand Up @@ -196,7 +196,6 @@ class QRegex::NFA {
@done[$st] := $gen;
for $!states[$st] -> $act, $arg, $to {
if $act == $EDGE_FATE {
say("# crossing fate edge $arg at $offset");
@fatepos[$arg] := $offset;
}
elsif $act == $EDGE_EPSILON && @done[$to] != $gen {
Expand Down

0 comments on commit 0bbd9c1

Please sign in to comment.