Canonicalize and constrain statement expr in purity inference mode

This commit is contained in:
Agus Zubiaga 2024-10-30 19:26:11 -03:00
parent 460fa693fd
commit 6e6382ab23
No known key found for this signature in database
14 changed files with 197 additions and 61 deletions

View file

@ -1,6 +1,6 @@
//! Pretty-prints the canonical AST back to check our work - do things look reasonable?
use crate::def::Def;
use crate::def::{Def, DefKind};
use crate::expr::Expr::{self, *};
use crate::expr::{
ClosureData, DeclarationTag, Declarations, FunctionDef, OpaqueWrapFunctionData,
@ -107,9 +107,13 @@ fn def<'a>(c: &Ctx, f: &'a Arena<'a>, d: &'a Def) -> DocBuilder<'a, Arena<'a>> {
expr_var: _,
pattern_vars: _,
annotation: _,
kind,
} = d;
def_help(c, f, &loc_pattern.value, &loc_expr.value)
match kind {
DefKind::Let => def_help(c, f, &loc_pattern.value, &loc_expr.value),
DefKind::Stmt(_) => expr(c, EPrec::Free, f, &loc_expr.value),
}
}
fn def_symbol_help<'a>(