Class: CodeTools::AST::SymbolLiteral
- Defined in:
- lib/rubinius/code/ast/literals.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
- #defined(g) ⇒ Object
-
#initialize(line, sym) ⇒ SymbolLiteral
constructor
A new instance of SymbolLiteral.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, sym) ⇒ SymbolLiteral
Returns a new instance of SymbolLiteral.
204 205 206 207 |
# File 'lib/rubinius/code/ast/literals.rb', line 204 def initialize(line, sym) @line = line @value = sym end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
202 203 204 |
# File 'lib/rubinius/code/ast/literals.rb', line 202 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
209 210 211 212 213 |
# File 'lib/rubinius/code/ast/literals.rb', line 209 def bytecode(g) pos(g) g.push_literal @value end |
#defined(g) ⇒ Object
215 216 217 |
# File 'lib/rubinius/code/ast/literals.rb', line 215 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
219 220 221 |
# File 'lib/rubinius/code/ast/literals.rb', line 219 def to_sexp [:lit, @value] end |