class Savi::Compiler::Verify::ErrorFinderVisitor

Overview

This visitor finds the most specific source positions that may raise errors.

Defined in:

savi/compiler/verify.cr

Constructors

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(node : AST::Node, jumps : Savi::Compiler::Jumps::Analysis) #

[View source]

Instance Method Detail

def found : Array(Savi::Source::Pos) #

[View source]
def jumps : Jumps::Analysis #

[View source]
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.


[View source]
def visit_any?(ctx, node) #

Only visit nodes that may raise an error.


[View source]
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.


[View source]