Class: CodeTools::AST::FloatLiteral
- Inherits:
-
Node
- Object
- Node
- CodeTools::AST::FloatLiteral
show all
- Defined in:
- lib/rubinius/ast/literals.rb
Instance Attribute Summary collapse
Attributes inherited from Node
#line
Instance Method Summary
collapse
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
95
96
97
98
|
# File 'lib/rubinius/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/ast/literals.rb', line 93
def value
@value
end
|
Instance Method Details
#bytecode(g) ⇒ Object
100
101
102
103
104
|
# File 'lib/rubinius/ast/literals.rb', line 100
def bytecode(g)
pos(g)
g.push_unique_literal @value
end
|
#defined(g) ⇒ Object
106
107
108
|
# File 'lib/rubinius/ast/literals.rb', line 106
def defined(g)
g.push_literal "expression"
end
|
#to_sexp ⇒ Object
110
111
112
|
# File 'lib/rubinius/ast/literals.rb', line 110
def to_sexp
[:lit, @value]
end
|