class Savi::Compiler::ServeDefinition

Overview

The purpose of the ServeDefinition pass is to look up the definition position of a given entity specified by the cursor's incoming position. When the [] method is called with a Source::Pos, it returns an output Source::Pos value that points to the found definition of that entity's source.

This pass does not mutate the Program topology. This pass does not mutate the AST. This pass does not raise any compilation errors. This pass keeps no state other than holding onto the Context. This pass produces no output state.

Defined in:

savi/compiler/serve_definition.cr

Instance Method Summary

Instance Method Detail

def [](f_link : Program::Function::Link, node : AST::Node) #

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

[View source]
def ctx : Context #

[View source]
def ctx? : Context | Nil #

[View source]
def run(ctx : Nil | Savi::Compiler::Context) #

[View source]