Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[v6] Fix shadowing of postcircumfix operators
  • Loading branch information
sorear committed Jan 12, 2011
1 parent b891411 commit b0be6ab
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion v6/TODO
Expand Up @@ -15,7 +15,7 @@ only slow me down...
* eager map optimizations
* return()
* stashes should be accessed as common values
* "Action method ::($name) not implemented" bug
* "Action method ::($name) not implemented", also needs $<sym>
* context accelerators need to robustly handle undefined objects
* .list, item as accelerated contexts
* explicitly imprecise error reporting - lines A-B
Expand Down
20 changes: 20 additions & 0 deletions v6/harness
Expand Up @@ -26,6 +26,26 @@ use RxOp;
use STD;

augment class NieczaActions {
sub node($M) { { line => $M.cursor.lineof($M.to) } }
method FALLBACK($meth, $/) {
if $meth eq '::($name)' { # XXX STD miscompilation
if $<O><prec> eq 't=' { # additive
make ::Op::Lexical.new(|node($/), name => '&infix:<' ~ self.get_op_sym($/) ~ '>');
} elsif $<semilist> && $<O><prec> eq 'y=' {
my $sym = $*GOAL eq '}' ?? '{ }' !! $*GOAL eq ']' ?? '[ ]' !!
die "Unhandled postcircumfix ending in $*GOAL";
make { postcircumfix => $sym, args => $<semilist>.ast };
}
return Nil;
} elsif substr($meth,0,7) eq 'prefix:' {
} elsif substr($meth,0,8) eq 'postfix:' {
} elsif substr($meth,0,6) eq 'infix:' {
make ::Op::Lexical.new(|node($/), name => '&infix:<' ~ self.get_op_sym($/) ~ '>');
return Nil;
} else {
$/.CURSOR.sorry("Action method $meth not yet implemented");
}
}
}

augment class STD { #OK exist
Expand Down
10 changes: 5 additions & 5 deletions v6/rebuild
@@ -1,6 +1,6 @@
../niecza_eval -v --stop-after=codegen harness
cp ../obj/*.dll run
cp ../obj/MAIN.exe run/Niecza.exe
cp ../obj/Kernel.dll ../obj/CLRBackend.exe obj
cp ../lib/*.setting lib
cp ../lib/Test.pm6 lib
cp -a ../obj/*.dll run
cp -a ../obj/MAIN.exe run/Niecza.exe
cp -a ../obj/Kernel.dll ../obj/CLRBackend.exe obj
cp -a ../lib/*.setting lib
cp -a ../lib/Test.pm6 lib

0 comments on commit b0be6ab

Please sign in to comment.