Skip to content

Commit

Permalink
Revert "* Update [if] to find other builtins."
Browse files Browse the repository at this point in the history
This reverts commit ab46f55.
  • Loading branch information
coke committed Oct 1, 2012
1 parent ab46f55 commit d80dc8b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ GEN_SOURCES = \
all: $(PARTCL_EXE) .revision

src/Partcl.pir: $(GEN_SOURCES)
src/Partcl/commands.pm: $(COMMANDS) src/init.pm src/Partcl/Grammar.pir
src/Partcl/commands.pm: $(COMMANDS) src/init.pm
echo "class Builtins {" > src/Partcl/commands.pm
cat $(COMMANDS) >> src/Partcl/commands.pm
echo "}" >> src/Partcl/commands.pm
Expand Down
5 changes: 1 addition & 4 deletions src/Partcl/commands/expr.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
use src::Partcl::Grammar;
use QAST;

method expr(*@args) {
my $code := nqp::join(' ', @args);
error("empty expression\nin expression \"\"")
Expand All @@ -16,7 +13,7 @@ method expr(*@args) {
:actions(Partcl::Actions)
);
if $parse {
&sub := QAST::Compiler.compile($parse.ast);
&sub := PAST::Compiler.compile($parse.ast);
%EXPRCACHE{$code} := ⊂
} else {
error("Invalid expression");
Expand Down
2 changes: 1 addition & 1 deletion src/Partcl/commands/if.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ method if(*@args) {

$body := @args.shift;
}
if self.expr($expr) { return self.eval($body); }
if expr($expr) { return eval($body); }
if @args {
my $else := @args.shift;
if $else ne 'elseif' {
Expand Down

0 comments on commit d80dc8b

Please sign in to comment.