Class: Duby::JVM::Types::FixnumLiteralNode
- Inherits:
-
AST::Fixnum
- Object
- AST::Node
- AST::Fixnum
- Duby::JVM::Types::FixnumLiteralNode
- Defined in:
- lib/duby/jvm/types/factory.rb
Instance Attribute Summary
Attributes included from AST::Literal
Attributes included from AST::Typed
Attributes inherited from AST::Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
Methods inherited from AST::Fixnum
Methods included from AST::Literal
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::Fixnum
Instance Method Details
#compile(compiler, expression) ⇒ Object
131 132 133 134 135 |
# File 'lib/duby/jvm/types/factory.rb', line 131 def compile(compiler, expression) if expression inferred_type.literal(compiler.method, @literal) end end |
#infer(typer) ⇒ Object
125 126 127 128 129 |
# File 'lib/duby/jvm/types/factory.rb', line 125 def infer(typer) return @inferred_type if resolved? resolved! @inferred_type = FixnumLiteral.new(@literal) end |