Skip to content

Commit

Permalink
Restore := to macrohood
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Sep 16, 2010
1 parent e273644 commit ff40fab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/SAFE.setting
Expand Up @@ -297,11 +297,6 @@ sub prefix:<++>($v) { $v = ($v + 1); $v }
sub postfix:<-->($v) { my $old = $v; $v = ($v - 1); $old }
sub postfix:<++>($v) { my $old = $v; $v = ($v + 1); $old }

sub infix:<:=> is rawcall { Q:CgOp {
(prog [bind 0 (pos 0) (pos 1)] [pos 0]) } }
sub infix:<::=> is rawcall { Q:CgOp {
(prog [bind 1 (pos 0) (pos 1)] [pos 0]) } }
sub prefix:<~>($v) { $v.Str } # should be Stringy
sub prefix:<?>($v) { $v.Bool }
sub prefix:<->($v) { 0 - $v }
Expand Down
6 changes: 6 additions & 0 deletions src/Niecza/Actions.pm
Expand Up @@ -984,6 +984,12 @@ sub INFIX { my ($cl, $M) = @_;
if ($s eq '&infix:<?? !!>') { # XXX macro
$M->{_ast} = Op::Conditional->new(node($M), check => $l,
true => $M->{middle}{_ast}, false => $r);
} elsif ($s eq '&infix:<:=>') {
$M->{_ast} = Op::Bind->new(node($M), readonly => 0, lhs => $l,
rhs => $r);
} elsif ($s eq '&infix:<::=>') {
$M->{_ast} = Op::Bind->new(node($M), readonly => 1, lhs => $l,
rhs => $r);
} elsif ($s eq '&infix:<,>') {
#XXX STD bug causes , in setting to be parsed as left assoc
my @r;
Expand Down

0 comments on commit ff40fab

Please sign in to comment.