Class: Rubinius::AST::FloatLiteral

Inherits:
Node
  • Object
show all
Defined in:
lib/compiler/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, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk

Constructor Details

#initialize(line, str) ⇒ FloatLiteral

Returns a new instance of FloatLiteral.



39
40
41
42
# File 'lib/compiler/ast/literals.rb', line 39

def initialize(line, str)
  @line = line
  @value = str.to_f
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



37
38
39
# File 'lib/compiler/ast/literals.rb', line 37

def value
  @value
end

Instance Method Details

#to_sexpObject



44
45
46
# File 'lib/compiler/ast/literals.rb', line 44

def to_sexp
  [:lit, @value]
end