class Savi::AST::ComposeString

Overview

A ComposeString is surrounded by double-quotes in source code much like a LiteralString, but rather than having a single static value, it is composed of some number of static string values (each a LiteralString) and some number of expressions bounded by escaped parentheses (each a Group). Together these static values and dynamic values are the list of terms.

example = "color: (color_value), size: (size_value)" ^~~~~~~ ^~~~~~~~ (static value terms) ^~~~~~~~~~~~~ ^~~~~~~~~~~~ (dynamic value terms) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (string compose)

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(terms : Array(Savi::AST::Node) = [] of Term, prefix_ident : Identifier | Nil = nil) #

[View source]

Instance Method Detail

def children_accept(ctx : Compiler::Context, visitor : Visitor) #

[View source]
def children_accept(ctx : Compiler::Context, visitor : CopyOnMutateVisitor) #

[View source]
def name #

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

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

[View source]
def terms : Array(Savi::AST::Node) #

[View source]
def terms=(terms : Array(Savi::AST::Node)) #

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

[View source]