class Savi::AST::LiteralString

Overview

A LiteralString is a value surrounded by double-quotes in source code, such as the right-hand-side of the assignment in the following example:

example = "example" ^~~~~~~

A LiteralString can have an optional prefix identifier, such as in the following example demonstrating a byte string (rather than a normal string), (in this case the prefix_ident is an Identifier pointing to the letter b):

example = b"example" ^~~~~~~

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 : String, prefix_ident : Identifier | Nil = nil) #

[View source]

Instance Method Detail

def name #

[View source]
def prefix_ident : Savi::AST::Identifier? #

[View source]
def prefix_ident=(prefix_ident : Nil | Savi::AST::Identifier) #

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

[View source]
def value : String #

[View source]
def value=(value : String) #

[View source]