Class: CodeTools::AST::NumberLiteral
- Defined in:
- lib/rubinius/code/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.
243 244 245 246 |
# File 'lib/rubinius/code/ast/literals.rb', line 243 def initialize(line, value) @line = line @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
241 242 243 |
# File 'lib/rubinius/code/ast/literals.rb', line 241 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
248 249 250 251 252 |
# File 'lib/rubinius/code/ast/literals.rb', line 248 def bytecode(g) pos(g) g.push_literal @value end |
#defined(g) ⇒ Object
254 255 256 |
# File 'lib/rubinius/code/ast/literals.rb', line 254 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
258 259 260 |
# File 'lib/rubinius/code/ast/literals.rb', line 258 def to_sexp [:lit, @value] end |