Skip to content

Commit

Permalink
Fix bug with iteration of empty character class
Browse files Browse the repository at this point in the history
It appears that it expects a

Fixes [Rakudo Issue #1622](rakudo/rakudo#1622)
  • Loading branch information
jstuder-gh committed Mar 23, 2018
1 parent b5f9716 commit 820c214
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/QRegex/P6Regex/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ class QRegex::P6Regex::Actions is HLL::Actions {
@alts.push(QAST::Regex.new( $str, :rxtype<enumcharlist>, :node($/), :negate( $<sign> eq '-' ),
:subtype($RXm ?? 'ignoremark' !! '') ))
if nqp::chars($str);
$qast := +@alts == 1 ?? @alts[0] !!
$<sign> eq '-' ??
$qast := ( my $num := +@alts ) == 1 ?? @alts[0] !!
0 < $num && $<sign> eq '-' ??
QAST::Regex.new( :rxtype<concat>, :node($/), :negate(1),
QAST::Regex.new( :rxtype<conj>, :subtype<zerowidth>, |@alts ),
QAST::Regex.new( :rxtype<cclass>, :name<.> ) ) !!
Expand Down

0 comments on commit 820c214

Please sign in to comment.