class Savi::AST::Identifier

Overview

An Identifier is any "bare word" in the source code, identifying something. In the following example of a local variable declaration whose value comes from a call with arguments, all of the underlined words are identifiers:

example SomeType'val = other_1.find("string", 90, other_2) ^~~~~~~ ^~~~~~~~ ^~~ ^~~~~~~ ^~~~ ^~~~~~~

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) #

[View source]

Instance Method Detail

def immediately_nested_within?(outer : AST::Identifier) : AST::Identifier | Nil #

If this identifier is immediately dot-nested within the given outer identifier, then return the nested portion as a new identifier.


[View source]
def name #

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

[View source]
def value : String #

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

[View source]