Class: Rubinius::ToolSet.current::TS::AST::NumberLiteral
- Defined in:
- lib/rubinius/ast/literals.rb
Direct Known Subclasses
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, value) ⇒ NumberLiteral
constructor
A new instance of NumberLiteral.
- #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, value) ⇒ NumberLiteral
Returns a new instance of NumberLiteral.
199 200 201 202 |
# File 'lib/rubinius/ast/literals.rb', line 199 def initialize(line, value) @line = line @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
197 198 199 |
# File 'lib/rubinius/ast/literals.rb', line 197 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
204 205 206 207 208 |
# File 'lib/rubinius/ast/literals.rb', line 204 def bytecode(g) pos(g) g.push_unique_literal @value end |
#defined(g) ⇒ Object
210 211 212 |
# File 'lib/rubinius/ast/literals.rb', line 210 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
214 215 216 |
# File 'lib/rubinius/ast/literals.rb', line 214 def to_sexp [:lit, @value] end |