class Savi::AST::LiteralCharacter

Overview

A LiteralCharacter is similar to a LiteralString, but it uses single-quotes and it resolves at parse time to a single integer value. For example, the following are character literals helping to define an array of bytes (which happen to be 5 ASCII letters followed by a newline byte):

example Array(U8)'val = ['h', 'e', 'l', 'l', 'o', '/n'] ^ ^ ^ ^ ^ ^~

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]