Module compute

Source
Expand description

This module is responsible of computing the semantic model of expressions and statements in the code, while type checking. It is invoked by queries for function bodies and other code blocks.

Structs§

ComputationContext
Context for computing the semantic model of expression trees.
Environment
A state which contains all the variables defined at the current resolver until now, and a pointer to the parent environment.
ExprAndId
Expression with its id.
NamedArg
Named argument in a function call.
PatternAndId

Enums§

ContextFunction

Functions§

compute_expr_block_semantic
Computes the semantic model of an expression of type ast::ExprBlock.
compute_expr_semantic
Computes the semantic model of an expression. Note that this expr will always be “registered” in the arena, so it can be looked up in the language server.
compute_named_argument_clause
Computes the semantic model of an expression of type ast::Arg.
compute_pattern_semantic
Computes the semantic model of a pattern. Note that this pattern will always be “registered” in the arena, so it can be looked up in the language server.
compute_root_expr
compute_statement_semantic
Computes the semantic model of a statement (excluding tail-expression).
get_binded_expr_by_name
Returns the requested variable from the environment if it exists. Returns None otherwise.
get_statement_item_by_name
Returns the requested item from the environment if it exists. Returns None otherwise.
maybe_compute_expr_semantic
Computes the semantic model of an expression, or returns a SemanticDiagnosticKind on error.
resolve_variable_by_name
Resolves a variable given a context and a simple name.

Type Aliases§

EnvVariables