Skip to content

Commit 295de92

Browse files
committed
More updates for QAST
1 parent 0a00651 commit 295de92

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

src/Partcl/Actions.pm

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ class Partcl::Actions is HLL::Actions {
1313
## register lexpad := DYNAMIC::<%LEXPAD>;
1414
## The body of the code to be evaluated
1515
my $lexpad_init :=
16-
QAST::Var.new( :name<lexpad>, :scope<register>,
17-
:viviself( QAST::Op.new(:op('pir::find_dynamic_lex__PS'), '%LEXPAD'))
18-
);
19-
16+
QAST::Var.new( :name<lexpad>, :scope<local>, :decl<var>);
17+
18+
19+
my $block;
2020
if ! nqp::isnull(pir::find_dynamic_lex__PS('@*PARTCL_COMPILER_NAMESPACE')) {
21-
QAST::Block.new( PAST::Stmts.new( $lexpad_init ), $past, :hll<tcl>,
21+
$block := QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past,
2222
:namespace(@*PARTCL_COMPILER_NAMESPACE)
2323
);
2424
} else {
25-
QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past, :hll<tcl>);
25+
$block := QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past);
2626
}
27+
QAST::CompUnit.new( :hll<tcl>, $block );
2728
}
2829

2930
## TOP_proc creates a PAST::Block that initializes a
@@ -36,26 +37,14 @@ class Partcl::Actions is HLL::Actions {
3637
## register lexpad :=
3738
## my %LEXPAD := TclLexPad.newpad(DYNAMIC::<%LEXPAD>);
3839
my $lexpad_init :=
39-
QAST::Var.new( :name<lexpad>, :scope<register>,
40-
:viviself(
41-
QAST::Var.new( :name<%LEXPAD>, :scope<lexical>,
42-
:viviself(
43-
QAST::Op.new(
44-
:pasttype<callmethod>, :name<newpad>,
45-
QAST::Var.new( :name<TclLexPad>, :scope<package>, :namespace<> ),
46-
QAST::Op.new(:op('pir::find_dynamic_lex__PS'), '%LEXPAD')
47-
)
48-
)
49-
)
50-
)
51-
);
40+
QAST::Var.new( :name<lexpad>, :scope<local>, :decl<var>);
5241

5342
if ! nqp::isnull(pir::find_dynamic_lex__PS('@*PARTCL_COMPILER_NAMESPACE')) {
54-
QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past, :hll<tcl>,
43+
QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past,
5544
:namespace(@*PARTCL_COMPILER_NAMESPACE)
5645
);
5746
} else {
58-
QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past, :hll<tcl>);
47+
QAST::Block.new( QAST::Stmts.new( $lexpad_init ), $past);
5948
}
6049
}
6150

@@ -189,7 +178,7 @@ class Partcl::Actions is HLL::Actions {
189178
190179
# Array access
191180
if $<key> {
192-
make PAST::Op.new( :pasttype<if>,
181+
make QAST::Op.new( :pasttype<if>,
193182
QAST::Op.new( :pirop<iseq__iss>,
194183
QAST::Op.new( :op<pir::typeof__SP>, $variable),
195184
QAST::Val.new( :value<TclArray>)

0 commit comments

Comments
 (0)