Class: Duby::JVM::Types::FloatLiteralNode

Inherits:
AST::Float show all
Defined in:
lib/duby/jvm/types/factory.rb

Instance Attribute Summary

Attributes included from AST::Literal

#literal

Attributes included from AST::Typed

#type

Attributes inherited from AST::Node

#children, #inferred_type, #newline, #parent, #position

Instance Method Summary collapse

Methods inherited from AST::Float

#initialize

Methods included from AST::Literal

#to_s

Methods inherited from AST::Node

#[], #each, #expr?, #initialize, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s

Constructor Details

This class inherits a constructor from Duby::AST::Float

Instance Method Details

#compile(compiler, expression) ⇒ Object



145
146
147
148
149
# File 'lib/duby/jvm/types/factory.rb', line 145

def compile(compiler, expression)
  if expression
    inferred_type.literal(compiler.method, @literal)
  end
end

#infer(typer) ⇒ Object



139
140
141
142
143
# File 'lib/duby/jvm/types/factory.rb', line 139

def infer(typer)
  return @inferred_type if resolved?
  resolved!
  @inferred_type = FloatLiteral.new(@literal)
end