Permalink
Browse files

"past" is now a thing of the ast

  • Loading branch information...
1 parent fb4ffa9 commit 15869c89e268ee52c19840d9547d15d74ec45d25 @lizmat lizmat committed Feb 14, 2014
View
@@ -76,26 +76,26 @@ class HLL::Actions {
method EXPR($/, $key?) {
unless $key { return 0; }
- my $past := $/.ast // $<OPER>.ast;
- unless $past {
- $past := QAST::Op.new( :node($/) );
+ my $ast := $/.ast // $<OPER>.ast;
+ unless $ast {
+ $ast := QAST::Op.new( :node($/) );
if $<OPER><O><op> {
- $past.op( ~$<OPER><O><op> );
+ $ast.op( ~$<OPER><O><op> );
}
if $key eq 'LIST' { $key := 'infix'; }
my $name := nqp::lc($key) ~ ':<' ~ $<OPER><sym> ~ '>';
- $past.name('&' ~ $name);
- unless $past.op {
- $past.op('call');
+ $ast.name('&' ~ $name);
+ unless $ast.op {
+ $ast.op('call');
}
}
if $key eq 'POSTFIX' {
- $past.unshift($/[0].ast);
+ $ast.unshift($/[0].ast);
}
else {
- for $/.list { if nqp::defined($_.ast) { $past.push($_.ast); } }
+ for $/.list { if nqp::defined($_.ast) { $ast.push($_.ast); } }
}
- make $past;
+ make $ast;
}
method term:sym<circumfix>($/) { make $<circumfix>.made }
@@ -114,23 +114,23 @@ class HLL::Actions {
method binint($/) { make self.string_to_int( $/, 2 ); }
method quote_EXPR($/) {
- my $past := $<quote_delimited>.ast;
+ my $ast := $<quote_delimited>.ast;
if %*QUOTEMOD<w> {
- if nqp::istype($past, QAST::SVal) {
- my @words := HLL::Grammar::split_words($/, $past.value);
+ if nqp::istype($ast, QAST::SVal) {
+ my @words := HLL::Grammar::split_words($/, $ast.value);
if +@words != 1 {
- $past := QAST::Op.new( :op('list'), :node($/) );
- for @words { $past.push(QAST::SVal.new( :value($_) )); }
+ $ast := QAST::Op.new( :op('list'), :node($/) );
+ for @words { $ast.push(QAST::SVal.new( :value($_) )); }
}
else {
- $past := QAST::SVal.new( :value(~@words[0]) );
+ $ast := QAST::SVal.new( :value(~@words[0]) );
}
}
else {
$/.CURSOR.panic("Can't form :w list from non-constant strings (yet)");
}
}
- make $past;
+ make $ast;
}
method quote_delimited($/) {
@@ -155,11 +155,11 @@ class HLL::Actions {
}
}
if $lastlit gt '' { @parts.push(QAST::SVal.new( :value($lastlit) )); }
- my $past := @parts ?? @parts.shift !! QAST::SVal.new( :value('') );
+ my $ast := @parts ?? @parts.shift !! QAST::SVal.new( :value('') );
while @parts {
- $past := QAST::Op.new( $past, @parts.shift, :op('concat') );
+ $ast := QAST::Op.new( $ast, @parts.shift, :op('concat') );
}
- make $past;
+ make $ast;
}
method quote_atom($/) {
View
@@ -67,10 +67,10 @@ class HLL::World {
}
# Adds a code reference to the root set of code refs.
- method add_root_code_ref($code_ref, $past_block) {
+ method add_root_code_ref($code_ref, $ast_block) {
my $code_ref_idx := $!num_code_refs;
$!num_code_refs := $!num_code_refs + 1;
- $!code_ref_blocks.push($past_block);
+ $!code_ref_blocks.push($ast_block);
nqp::scsetcode($!sc, $code_ref_idx, $code_ref);
$code_ref_idx
}
@@ -87,23 +87,23 @@ class HLL::World {
# Add an event that we want to run before deserialization or before any
# other fixup.
- method add_load_dependency_task(:$deserialize_past, :$fixup_past) {
+ method add_load_dependency_task(:$deserialize_ast, :$fixup_ast) {
if $!precomp_mode {
- @!load_dependency_tasks.push($deserialize_past) if $deserialize_past;
+ @!load_dependency_tasks.push($deserialize_ast) if $deserialize_ast;
}
else {
- @!load_dependency_tasks.push($fixup_past) if $fixup_past;
+ @!load_dependency_tasks.push($fixup_ast) if $fixup_ast;
}
}
# Add an event that we need to run at fixup time (after deserialization of
# between compilation and runtime).
- method add_fixup_task(:$deserialize_past, :$fixup_past) {
+ method add_fixup_task(:$deserialize_ast, :$fixup_ast) {
if $!precomp_mode {
- @!fixup_tasks.push($deserialize_past) if $deserialize_past;
+ @!fixup_tasks.push($deserialize_ast) if $deserialize_ast;
}
else {
- @!fixup_tasks.push($fixup_past) if $fixup_past;
+ @!fixup_tasks.push($fixup_ast) if $fixup_ast;
}
}
Oops, something went wrong.

0 comments on commit 15869c8

Please sign in to comment.