class Savi::Compiler::Macros::SimpleIdentifiers

Overview

Handle simple identifier macros like error! and return with no value. We run these as a separate micro-pass so that we can ensure all other macros have already been expanded before attempting to expand any of these. Otherwise, these may interfere with expansion of multi-term forms that use the same identifier as a marker (for example, return VALUE).

Defined in:

savi/compiler/macros.cr

Constructors

Class Method Summary

Instance Method Summary

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

visit(ctx : Compiler::Context, node : Node) visit, visit_any?(ctx : Compiler::Context, node : Node) visit_any?, visit_children?(ctx : Compiler::Context, node : Node) visit_children?, visit_pre(ctx : Compiler::Context, node : Node) visit_pre

Constructor Detail

def self.new(macros : Savi::Compiler::Macros) #

[View source]

Class Method Detail

def self.run(ctx : Context, f : Program::Function, macros : Macros) #

[View source]

Instance Method Detail

def is_valid_sequential_context? #

[View source]
def macros : Macros #

[View source]
def maybe_replace(ctx, node : AST::Node) #

[View source]
def post_observe(ctx, node : AST::Node) #

[View source]
def pre_observe(ctx, node : AST::Node) #

[View source]
def visit(ctx, node : AST::Node) #

[View source]
def visit_pre(ctx, node : AST::Node) #

[View source]