class Savi::Compiler::Common::FindByPos

Defined in:

savi/compiler/common/find_by_pos.cr

Constructors

Class Method Summary

Instance Method Summary

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

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(pos : Savi::Source::Pos, t_link : Savi::Program::Type::Link | Nil, f_link : Savi::Program::Function::Link | Nil) #

[View source]

Class Method Detail

def self.find(ctx : Context, pos : Source::Pos) #

Given a source position, try to find the AST nodes that contain it. Currently this only works within functions, but could be expanded to types. When found, returns the instance of this class with the reverse_path filled. When not found, returns nil.


[View source]
def self.find_within(ctx : Context, pos : Source::Pos, package : Program::Package, t : Program::Type | Nil, f : Program::Function | Nil, node : AST::Node) #

[View source]

Instance Method Detail

def f_link : Program::Function::Link | Nil #

[View source]
def pos : Source::Pos #

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

[View source]
def t_link : Program::Type::Link | Nil #

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

[View source]
def visit_any?(ctx : Context, node : AST::Node) #

[View source]