class Savi::Compiler::Verify::ErrorFinderVisitor
- Savi::Compiler::Verify::ErrorFinderVisitor
- Savi::AST::Visitor
- Reference
- Object
Overview
This visitor finds the most specific source positions that may raise errors.
Defined in:
savi/compiler/verify.crConstructors
Instance Method Summary
- #found : Array(Savi::Source::Pos)
- #jumps : Jumps::Analysis
-
#visit(ctx, node)
Save this source position if it is the deepest node in this branch of the tree that we visited, recognizing that we skipped no-error branches.
-
#visit_any?(ctx, node)
Only visit nodes that may raise an error.
-
#visit_pre(ctx, node : Savi::AST::Node)
Before visiting a node's children, mark this node as the deepest.
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
Instance Method Detail
def visit(ctx, node)
#
Save this source position if it is the deepest node in this branch of the tree that we visited, recognizing that we skipped no-error branches.
def visit_pre(ctx, node : Savi::AST::Node)
#
Before visiting a node's children, mark this node as the deepest. If any children can also raise errors, they will be the new deepest ones, removing this node from the possibility of being considered deepest.