class Savi::Compiler::Common::FindByPos
- Savi::Compiler::Common::FindByPos
- Savi::AST::Visitor
- Reference
- Object
Defined in:
savi/compiler/common/find_by_pos.crConstructors
Class Method Summary
-
.find(ctx : Context, pos : Source::Pos)
Given a source position, try to find the AST nodes that contain it.
- .find_within(ctx : Context, pos : Source::Pos, package : Program::Package, t : Program::Type | Nil, f : Program::Function | Nil, node : AST::Node)
Instance Method Summary
- #f_link : Program::Function::Link | Nil
- #pos : Source::Pos
- #reverse_path : Array(AST::Node)
- #t_link : Program::Type::Link | Nil
- #visit(ctx : Context, node : AST::Node)
- #visit_any?(ctx : Context, node : AST::Node)
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)
#
Class Method Detail
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.
def self.find_within(ctx : Context, pos : Source::Pos, package : Program::Package, t : Program::Type | Nil, f : Program::Function | Nil, node : AST::Node)
#