Desugared.Desugared_to_scopeSourceTranslation from Desugared.Ast to Scopelang.Ast
val def_map_to_tree :
Ast.ScopeDef.t ->
Scopelang.Ast.typ Pos.marked option ->
Ast.rule Ast.RuleMap.t ->
rule_tree listTransforms a flat list of rules into a tree, taking into account the priorities declared between rules
Invariant: there are no exceptions cycles
Invariant: there are no dandling exception pointers in the rules
val rule_tree_to_expr :
toplevel:bool ->
Scopelang.Ast.Var.t option ->
rule_tree ->
Scopelang.Ast.expr Pos.marked Bindlib.boxFrom the rule_tree, builds an Dcalc.Ast.EDefault expression in the scope language. The ~toplevel parameter is used to know when to place the toplevel binding in the case of functions.
val translate_def :
Ast.ScopeDef.t ->
Ast.rule Ast.RuleMap.t ->
Scopelang.Ast.typ Pos.marked ->
Scopelang.Ast.expr Pos.markedTranslates a definition inside a scope, the resulting expression should be an
Dcalc.Ast.EDefault
Translates a scope