Improve debug printing for can decls

This commit is contained in:
Ayaz Hafiz 2023-03-25 18:04:38 -05:00
parent e549c8b4a3
commit d2b9a1a33c
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 10 additions and 7 deletions

View file

@ -35,7 +35,10 @@ pub fn pretty_print_declarations(c: &Ctx, declarations: &Declarations) -> String
DeclarationTag::Expectation => todo!(), DeclarationTag::Expectation => todo!(),
DeclarationTag::ExpectationFx => todo!(), DeclarationTag::ExpectationFx => todo!(),
DeclarationTag::Destructure(_) => todo!(), DeclarationTag::Destructure(_) => todo!(),
DeclarationTag::MutualRecursion { .. } => todo!(), DeclarationTag::MutualRecursion { .. } => {
// the defs will be printed next
continue;
}
}; };
defs.push(def); defs.push(def);
@ -123,9 +126,10 @@ fn toplevel_function<'a>(
.append(f.line()) .append(f.line())
.append(f.text("\\")) .append(f.text("\\"))
.append(f.intersperse(args, f.text(", "))) .append(f.intersperse(args, f.text(", ")))
.append(f.text("->")) .append(f.text(" ->"))
.group()
.append(f.line()) .append(f.line())
.append(expr(c, EPrec::Free, f, body)) .append(expr(c, EPrec::Free, f, body).group())
.nest(2) .nest(2)
.group() .group()
} }

View file

@ -8608,12 +8608,11 @@ mod solve_expr {
v2 = "" v2 = ""
apply = \fnParser, valParser-> \{} -[9]-> (fnParser {}) valParser apply = \fnParser, valParser -> \{} -[9]-> (fnParser {}) valParser
map = \simpleParser, transform-> apply \{} -[12]-> transform simpleParser map = \simpleParser, transform -> apply \{} -[12]-> transform simpleParser
parseInput = parseInput = \{} ->
\{}->
when [ when [
map v1 \{} -[13]-> "", map v1 \{} -[13]-> "",
map v2 \s -[14]-> s, map v2 \s -[14]-> s,