class Savi::AST::LiteralInteger

Overview

A LiteralInteger is an integer-appearing number in the source code, which resolves at parse time to an integer value, including support for explicitly negative numbers, such as in this example (whose value is -99):

example_int I32 = -99 ^~~

Note that because the true inferred types are not yet known at parse-time, this AST type is also used for floating-point values which "look" like integers, such as in the following example:

example_int F32 = -99 ^~~

Defined in:

savi/ast.cr

Constructors

Instance Method Summary

Instance methods inherited from class Savi::AST::Node

accept(ctx : Compiler::Context, visitor : Visitor)
accept(ctx : Compiler::Context, visitor : CopyOnMutateVisitor)
accept
, annotations : Array(Annotation) | Nil annotations, annotations=(annotations : Array(Annotation) | Nil) annotations=, children_accept(ctx : Compiler::Context, visitor : Visitor)
children_accept(ctx : Compiler::Context, visitor : CopyOnMutateVisitor)
children_accept
, from(other : Node) from, pos pos, pos? : Savi::Source::Pos? pos?, span_pos(source) span_pos, with_pos(pos : Source::Pos) with_pos

Constructor Detail

def self.new(value : UInt64 | Int64) #

[View source]

Instance Method Detail

def name #

[View source]
def to_a : Array(A) #

[View source]
def value : Int64 | UInt64 #

[View source]
def value=(value : Int64 | UInt64) #

[View source]