Skip to content

Commit 15869c8

Browse files
committed
"past" is now a thing of the ast
1 parent fb4ffa9 commit 15869c8

File tree

12 files changed

+331
-331
lines changed

12 files changed

+331
-331
lines changed

src/HLL/Actions.nqp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,26 @@ class HLL::Actions {
7676

7777
method EXPR($/, $key?) {
7878
unless $key { return 0; }
79-
my $past := $/.ast // $<OPER>.ast;
80-
unless $past {
81-
$past := QAST::Op.new( :node($/) );
79+
my $ast := $/.ast // $<OPER>.ast;
80+
unless $ast {
81+
$ast := QAST::Op.new( :node($/) );
8282
if $<OPER><O><op> {
83-
$past.op( ~$<OPER><O><op> );
83+
$ast.op( ~$<OPER><O><op> );
8484
}
8585
if $key eq 'LIST' { $key := 'infix'; }
8686
my $name := nqp::lc($key) ~ ':<' ~ $<OPER><sym> ~ '>';
87-
$past.name('&' ~ $name);
88-
unless $past.op {
89-
$past.op('call');
87+
$ast.name('&' ~ $name);
88+
unless $ast.op {
89+
$ast.op('call');
9090
}
9191
}
9292
if $key eq 'POSTFIX' {
93-
$past.unshift($/[0].ast);
93+
$ast.unshift($/[0].ast);
9494
}
9595
else {
96-
for $/.list { if nqp::defined($_.ast) { $past.push($_.ast); } }
96+
for $/.list { if nqp::defined($_.ast) { $ast.push($_.ast); } }
9797
}
98-
make $past;
98+
make $ast;
9999
}
100100

101101
method term:sym<circumfix>($/) { make $<circumfix>.made }
@@ -114,23 +114,23 @@ class HLL::Actions {
114114
method binint($/) { make self.string_to_int( $/, 2 ); }
115115

116116
method quote_EXPR($/) {
117-
my $past := $<quote_delimited>.ast;
117+
my $ast := $<quote_delimited>.ast;
118118
if %*QUOTEMOD<w> {
119-
if nqp::istype($past, QAST::SVal) {
120-
my @words := HLL::Grammar::split_words($/, $past.value);
119+
if nqp::istype($ast, QAST::SVal) {
120+
my @words := HLL::Grammar::split_words($/, $ast.value);
121121
if +@words != 1 {
122-
$past := QAST::Op.new( :op('list'), :node($/) );
123-
for @words { $past.push(QAST::SVal.new( :value($_) )); }
122+
$ast := QAST::Op.new( :op('list'), :node($/) );
123+
for @words { $ast.push(QAST::SVal.new( :value($_) )); }
124124
}
125125
else {
126-
$past := QAST::SVal.new( :value(~@words[0]) );
126+
$ast := QAST::SVal.new( :value(~@words[0]) );
127127
}
128128
}
129129
else {
130130
$/.CURSOR.panic("Can't form :w list from non-constant strings (yet)");
131131
}
132132
}
133-
make $past;
133+
make $ast;
134134
}
135135

136136
method quote_delimited($/) {
@@ -155,11 +155,11 @@ class HLL::Actions {
155155
}
156156
}
157157
if $lastlit gt '' { @parts.push(QAST::SVal.new( :value($lastlit) )); }
158-
my $past := @parts ?? @parts.shift !! QAST::SVal.new( :value('') );
158+
my $ast := @parts ?? @parts.shift !! QAST::SVal.new( :value('') );
159159
while @parts {
160-
$past := QAST::Op.new( $past, @parts.shift, :op('concat') );
160+
$ast := QAST::Op.new( $ast, @parts.shift, :op('concat') );
161161
}
162-
make $past;
162+
make $ast;
163163
}
164164

165165
method quote_atom($/) {

src/HLL/World.nqp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ class HLL::World {
6767
}
6868

6969
# Adds a code reference to the root set of code refs.
70-
method add_root_code_ref($code_ref, $past_block) {
70+
method add_root_code_ref($code_ref, $ast_block) {
7171
my $code_ref_idx := $!num_code_refs;
7272
$!num_code_refs := $!num_code_refs + 1;
73-
$!code_ref_blocks.push($past_block);
73+
$!code_ref_blocks.push($ast_block);
7474
nqp::scsetcode($!sc, $code_ref_idx, $code_ref);
7575
$code_ref_idx
7676
}
@@ -87,23 +87,23 @@ class HLL::World {
8787

8888
# Add an event that we want to run before deserialization or before any
8989
# other fixup.
90-
method add_load_dependency_task(:$deserialize_past, :$fixup_past) {
90+
method add_load_dependency_task(:$deserialize_ast, :$fixup_ast) {
9191
if $!precomp_mode {
92-
@!load_dependency_tasks.push($deserialize_past) if $deserialize_past;
92+
@!load_dependency_tasks.push($deserialize_ast) if $deserialize_ast;
9393
}
9494
else {
95-
@!load_dependency_tasks.push($fixup_past) if $fixup_past;
95+
@!load_dependency_tasks.push($fixup_ast) if $fixup_ast;
9696
}
9797
}
9898

9999
# Add an event that we need to run at fixup time (after deserialization of
100100
# between compilation and runtime).
101-
method add_fixup_task(:$deserialize_past, :$fixup_past) {
101+
method add_fixup_task(:$deserialize_ast, :$fixup_ast) {
102102
if $!precomp_mode {
103-
@!fixup_tasks.push($deserialize_past) if $deserialize_past;
103+
@!fixup_tasks.push($deserialize_ast) if $deserialize_ast;
104104
}
105105
else {
106-
@!fixup_tasks.push($fixup_past) if $fixup_past;
106+
@!fixup_tasks.push($fixup_ast) if $fixup_ast;
107107
}
108108
}
109109

0 commit comments

Comments
 (0)