Class: Rubinius::AST::VariableAssignment
- Defined in:
- lib/compiler/ast/variables.rb
Direct Known Subclasses
ClassVariableAssignment, GlobalVariableAssignment, InstanceVariableAssignment, LocalVariableAssignment
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #defined(g) ⇒ Object
-
#initialize(line, name, value) ⇒ VariableAssignment
constructor
A new instance of VariableAssignment.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, name, value) ⇒ VariableAssignment
Returns a new instance of VariableAssignment.
61 62 63 64 65 |
# File 'lib/compiler/ast/variables.rb', line 61 def initialize(line, name, value) @line = line @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
59 60 61 |
# File 'lib/compiler/ast/variables.rb', line 59 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
59 60 61 |
# File 'lib/compiler/ast/variables.rb', line 59 def value @value end |
Instance Method Details
#defined(g) ⇒ Object
67 68 69 |
# File 'lib/compiler/ast/variables.rb', line 67 def defined(g) g.push_literal "assignment" end |
#to_sexp ⇒ Object
71 72 73 74 75 |
# File 'lib/compiler/ast/variables.rb', line 71 def to_sexp sexp = [sexp_name, @name] sexp << @value.to_sexp if @value sexp end |