Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Put PAST::Stmt register boundaries on ST.set_attribute[_typed].
  • Loading branch information
pmichaud committed Jun 14, 2011
1 parent 28995b9 commit 2f3a8d3
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/Perl6/SymbolTable.pm
Expand Up @@ -530,28 +530,32 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
# Helper to make PAST for setting an attribute to a value. Value should
# be a PAST tree.
method set_attribute($obj, $class, $name, $value_past) {
PAST::Op.new(
:pasttype('bind_6model'),
PAST::Var.new(
:name($name), :scope('attribute_6model'),
self.get_object_sc_ref_past($obj),
self.get_object_sc_ref_past($class)
),
$value_past
PAST::Stmt.new(
PAST::Op.new(
:pasttype('bind_6model'),
PAST::Var.new(
:name($name), :scope('attribute_6model'),
self.get_object_sc_ref_past($obj),
self.get_object_sc_ref_past($class)
),
$value_past
)
)
}

# Helper to make PAST for setting a typed attribute to a value. Value should
# be a PAST tree.
method set_attribute_typed($obj, $class, $name, $value_past, $type) {
PAST::Op.new(
:pasttype('bind_6model'),
PAST::Var.new(
:name($name), :scope('attribute_6model'), :type($type),
self.get_object_sc_ref_past($obj),
self.get_object_sc_ref_past($class)
),
$value_past
PAST::Stmt.new(
PAST::Op.new(
:pasttype('bind_6model'),
PAST::Var.new(
:name($name), :scope('attribute_6model'), :type($type),
self.get_object_sc_ref_past($obj),
self.get_object_sc_ref_past($class)
),
$value_past
)
)
}

Expand Down

0 comments on commit 2f3a8d3

Please sign in to comment.