Class: Malady::AST::AssignNode
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(filename, line, name, value) ⇒ AssignNode
constructor
A new instance of AssignNode.
Methods inherited from Node
Constructor Details
#initialize(filename, line, name, value) ⇒ AssignNode
Returns a new instance of AssignNode.
115 116 117 118 119 |
# File 'lib/malady/ast.rb', line 115 def initialize(filename, line, name, value) super @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
113 114 115 |
# File 'lib/malady/ast.rb', line 113 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
113 114 115 |
# File 'lib/malady/ast.rb', line 113 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
121 122 123 124 125 126 |
# File 'lib/malady/ast.rb', line 121 def bytecode(g) pos(g) local = g.state.scope.new_local(name) value.bytecode(g) local.reference.set_bytecode(g) end |