Class: CodeTools::AST::LocalVariableAssignment
- Inherits:
-
VariableAssignment
- Object
- Node
- VariableAssignment
- CodeTools::AST::LocalVariableAssignment
- Includes:
- LocalVariable
- Defined in:
- lib/rubinius/code/ast/variables.rb
Instance Attribute Summary
Attributes included from LocalVariable
Attributes inherited from VariableAssignment
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(line, name, value = nil) ⇒ LocalVariableAssignment
constructor
A new instance of LocalVariableAssignment.
- #sexp_name ⇒ Object
Methods included from LocalVariable
Methods inherited from VariableAssignment
Methods inherited from Node
#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #to_sexp, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, name, value = nil) ⇒ LocalVariableAssignment
Returns a new instance of LocalVariableAssignment.
503 504 505 506 507 508 |
# File 'lib/rubinius/code/ast/variables.rb', line 503 def initialize(line, name, value=nil) @line = line @name = name @value = value @variable = nil end |
Instance Method Details
#bytecode(g) ⇒ Object
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/rubinius/code/ast/variables.rb', line 510 def bytecode(g) unless @variable g.state.scope.assign_local_reference self end if @value @value.bytecode(g) end # Set the position after the value, so the position # reflects where the assignment itself is done pos(g) @variable.set_bytecode(g) end |
#sexp_name ⇒ Object
526 527 528 |
# File 'lib/rubinius/code/ast/variables.rb', line 526 def sexp_name :lasgn end |