Class: Rubinius::AST::ConstantAssignment
- Defined in:
- lib/compiler/ast/constants.rb
Instance Attribute Summary collapse
-
#constant ⇒ Object
Returns the value of attribute constant.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, expr, value) ⇒ ConstantAssignment
constructor
A new instance of ConstantAssignment.
- #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, expr, value) ⇒ ConstantAssignment
Returns a new instance of ConstantAssignment.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/compiler/ast/constants.rb', line 63 def initialize(line, expr, value) @line = line @value = value if expr.kind_of? Symbol @constant = ConstantAccess.new line, expr else @constant = expr end end |
Instance Attribute Details
#constant ⇒ Object
Returns the value of attribute constant.
61 62 63 |
# File 'lib/compiler/ast/constants.rb', line 61 def constant @constant end |
#value ⇒ Object
Returns the value of attribute value.
61 62 63 |
# File 'lib/compiler/ast/constants.rb', line 61 def value @value end |
Instance Method Details
#to_sexp ⇒ Object
74 75 76 77 78 |
# File 'lib/compiler/ast/constants.rb', line 74 def to_sexp sexp = [:cdecl, @constant.assign_sexp] sexp << @value.to_sexp if @value sexp end |