Class: CodeTools::AST::FloatLiteral
- 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, str) ⇒ FloatLiteral
constructor
A new instance of FloatLiteral.
- #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, str) ⇒ FloatLiteral
Returns a new instance of FloatLiteral.
95 96 97 98 |
# File 'lib/rubinius/code/ast/literals.rb', line 95 def initialize(line, str) @line = line @value = str.to_f end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
93 94 95 |
# File 'lib/rubinius/code/ast/literals.rb', line 93 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
100 101 102 103 104 |
# File 'lib/rubinius/code/ast/literals.rb', line 100 def bytecode(g) pos(g) g.push_float @value end |
#defined(g) ⇒ Object
106 107 108 |
# File 'lib/rubinius/code/ast/literals.rb', line 106 def defined(g) g.push_literal "expression" end |
#to_sexp ⇒ Object
110 111 112 |
# File 'lib/rubinius/code/ast/literals.rb', line 110 def to_sexp [:lit, @value] end |