Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix compiler crash on [+]
  • Loading branch information
sorear committed Mar 1, 2011
1 parent 31427c7 commit 12393a7
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/niecza
Expand Up @@ -32,6 +32,40 @@ method bif_simple_eval($str) { self._cgop("bif_simple_eval", $str) }
}

augment class STD::P6 { #OK exist
my %list_prefix = (:dba('list prefix') , :prec<e=>, :assoc<unary>, :uassoc<left>);
regex prefix_circumfix_meta_operator:reduce {
:my $*IN_REDUCE = 1;
:my ($op, $term);
<?before '['\S+']'>
$<s> = (
'['
[
|| <op=.infixish('red')> <?before ']'>
|| \\<op=.infixish('tri')> <?before ']'>
|| <!>
]
']' ['«'|<?>]
)
{ $op = $<s><op>; }

<.can_meta($op, "reduce with")>

[
|| <!{ $op<O><diffy> }>
|| <?{ $op<O><assoc> eq 'chain' }>
|| <.sorry("Can't reduce with " ~ $op<sym> ~ " because " ~ $op<O><dba> ~ " operators are diffy and not chaining")>
]

[
|| <?before '('>
|| <?before \s+ [ <?stdstopper> { $term = 1 } ]? >
|| { $term = 1 }
]

<O(|%($op<O>), |%list_prefix, assoc => 'unary', uassoc => 'left', term => $term)>
$<sym> = {$<s>.Str}

}
}

augment class RxOp::Sym { #OK exist
Expand Down

0 comments on commit 12393a7

Please sign in to comment.