Module analysis

Source
Expand description

This module provides helpers to perform (semantic) analysis over Modusfile ASTs.

We use a fixpoint approach to evaluate predicate kinds, which deals with the issue of recursion. Clauses are repeatedly ‘applied’ until a fixpoint. Instead of trying to work out the proper order we should ‘apply’ clauses, we apply all of them, and if we cannot evaluate some expression body because we haven’t evaluated a future predicate kind yet, we move on - eventually it will be handled. However, we make an assumption on what an expression body’s kind is whenever an incorrect assumption must lead to an error. For example, in e1 ; e2, if e1 is an image kind then we’ll error if e2 is not an image kind, so we may as well assume it is and error later if needed.

Structs§

KindResult

Enums§

Kind

Traits§

ModusSemantics
A trait for objects that have some interpretation w.r.t. the build graph.

Functions§

check_and_output_analysis
Returns true if the results of the check were satisfactory; we don’t need to terminate.