Permalink
Browse files

Revert "Fix broken parsing of signs in character classes"

May be a STDbug, breaks colomon's code.
This reverts commit 1666bb5.
  • Loading branch information...
1 parent 1666bb5 commit c5422a51d77b557845e9ae5253efd9172a816541 @sorear committed Aug 23, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/NieczaActions.pm6
  2. +1 −1 src/STD.pm6
View
@@ -907,7 +907,6 @@ method cc_to_rxop($z) {
method cclass_expr($/) {
my @ops = @$<op>;
my @zyg = map *.ast, @$<cclass_union>;
- if $<sign> eq '-' { @zyg[0] = self.negate_cc(@zyg[0]) }
for @ops -> $op {
my $z1 = shift @zyg;
my $z2 = shift @zyg;
@@ -926,6 +925,7 @@ method cclass_union($/) {
method cclass_add($/) {
my ($a, @zyg) = map *.ast, @$<cclass_elem>;
+ if $<sign> eq '-' { $a = self.negate_cc($a) }
for @$<op> {
$a = ($_ eq '+') ?? self.or_cc($a, shift(@zyg))
!! self.and_cc($a, self.negate_cc(shift(@zyg)));
View
@@ -5031,7 +5031,6 @@ grammar Regex is STD {
token cclass_expr {
::
<.normspace>?
- <sign>
<cclass_union>+ % [$<op>=[ '|' | '^' ]]
}
@@ -5042,6 +5041,7 @@ grammar Regex is STD {
token cclass_add {
<.normspace>?
+ <sign>
<cclass_elem>+ % [$<op>=[ '+' | '-' ]<.normspace>?]
}

0 comments on commit c5422a5

Please sign in to comment.