Mint::Scope
The class is responsible for keeping track of which variable is pointing to which node.
The data structure is a tree where leaves are the levels of the child nodes of an AST node and a level is a container for the possible targets.
When resolving a variable we traverse it's tree upwards to find the target which matches the value of the variable.
Constructors
new(ast : Ast)
SourceInstance methods
Adds a target to the level of the given node.
build(node : Ast::Node | Nil, parent : Ast::Node)
SourceBuilds an array of nodes. If stack is true then each node will be the
child of the previous nodes.
create(node : Ast::Node, parent : Ast::Node | Nil = nil)
Builds a level for the node and yields the parents scope.
find_parent_by_class(node, classes)
Sourceresolve
Resolves the targets which can be statically resolved, currently only the exposed variables of a connected entity in a component.
root
Source