Skip to content

Commit e36459c

Browse files
committed
Simplify code-gen with QAST::Var changes.
1 parent b6921f3 commit e36459c

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/NQP/World.nqp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,22 +171,12 @@ class NQP::World is HLL::World {
171171
}
172172

173173
# Installs a lexical symbol. Takes a QAST::Block object, name and
174-
# the object to install. Does an immediate installation in the
175-
# compile-time block symbol table, and ensures that the installation
176-
# gets fixed up at runtime too.
174+
# the object to install.
177175
method install_lexical_symbol($block, $name, $obj) {
178-
# Install the object directly as a block symbol.
179176
$block.symbol($name, :scope('lexical'), :value($obj));
180-
$block[0].push(QAST::Var.new( :scope('lexical'), :name($name), :decl('var') ));
181-
182-
# Fixup and deserialization task is the same.
183-
my $fixup := QAST::Op.new(
184-
:op('setstaticlex'),
185-
$block,
186-
QAST::SVal.new( :value($name) ),
187-
QAST::WVal.new( :value($obj) )
188-
);
189-
self.add_fixup_task(:deserialize_past($fixup), :fixup_past($fixup));
177+
$block[0].push(QAST::Var.new(
178+
:scope('lexical'), :name($name), :decl('static'), :value($obj)
179+
));
190180
}
191181

192182
# Adds a fixup to install a specified QAST::Block in a package under the

0 commit comments

Comments
 (0)