This commit is contained in:
Ayaz Hafiz 2022-12-03 23:43:47 -06:00
parent e296d35bcd
commit d660016b53
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
4 changed files with 8 additions and 9 deletions

View file

@ -744,7 +744,7 @@ impl<'a> WasmBackend<'a> {
let mut current_stmt = stmt; let mut current_stmt = stmt;
while let Stmt::Let(sym, expr, layout, following) = current_stmt { while let Stmt::Let(sym, expr, layout, following) = current_stmt {
if DEBUG_SETTINGS.let_stmt_ir { if DEBUG_SETTINGS.let_stmt_ir {
print!("\nlet {:?} = {}", sym, expr.to_pretty(200)); print!("\nlet {:?} = {}", sym, expr.to_pretty(200, true));
} }
let kind = match following { let kind = match following {
@ -974,7 +974,7 @@ impl<'a> WasmBackend<'a> {
self.register_symbol_debug_names(); self.register_symbol_debug_names();
println!( println!(
"## rc_stmt:\n{}\n{:?}", "## rc_stmt:\n{}\n{:?}",
rc_stmt.to_pretty(self.env.layout_interner, 200), rc_stmt.to_pretty(self.env.layout_interner, 200, true),
rc_stmt rc_stmt
); );
} }
@ -1078,7 +1078,7 @@ impl<'a> WasmBackend<'a> {
Expr::Reset { symbol: arg, .. } => self.expr_reset(*arg, sym, storage), Expr::Reset { symbol: arg, .. } => self.expr_reset(*arg, sym, storage),
Expr::RuntimeErrorFunction(_) => { Expr::RuntimeErrorFunction(_) => {
todo!("Expression `{}`", expr.to_pretty(100)) todo!("Expression `{}`", expr.to_pretty(100, false))
} }
} }
} }

View file

@ -143,7 +143,7 @@ pub fn build_app_module<'a>(
if DEBUG_SETTINGS.user_procs_ir { if DEBUG_SETTINGS.user_procs_ir {
println!("## procs"); println!("## procs");
for proc in procs.iter() { for proc in procs.iter() {
println!("{}", proc.to_pretty(env.layout_interner, 200)); println!("{}", proc.to_pretty(env.layout_interner, 200, true));
// println!("{:?}", proc); // println!("{:?}", proc);
} }
} }
@ -161,7 +161,7 @@ pub fn build_app_module<'a>(
if DEBUG_SETTINGS.helper_procs_ir { if DEBUG_SETTINGS.helper_procs_ir {
println!("## helper_procs"); println!("## helper_procs");
for proc in helper_procs.iter() { for proc in helper_procs.iter() {
println!("{}", proc.to_pretty(env.layout_interner, 200)); println!("{}", proc.to_pretty(env.layout_interner, 200, true));
// println!("{:#?}", proc); // println!("{:#?}", proc);
} }
} }

View file

@ -102,12 +102,11 @@ fn format_sourced_doc<'d>(f: &'d Arena<'d>, line: usize, source: &str, doc: Doc<
fn format_header<'d>(f: &'d Arena<'d>, title: &str) -> Doc<'d> { fn format_header<'d>(f: &'d Arena<'d>, title: &str) -> Doc<'d> {
let title_width = title.len() + 4; let title_width = title.len() + 4;
let header = f.text(format!( f.text(format!(
"── {} {}", "── {} {}",
title, title,
"".repeat(HEADER_WIDTH - title_width) "".repeat(HEADER_WIDTH - title_width)
)); ))
header
} }
fn format_kind<'a, 'd, I>( fn format_kind<'a, 'd, I>(

View file

@ -148,7 +148,7 @@ fn compiles_to_ir(test_name: &str, src: &str, no_check: bool) {
let main_fn_symbol = exposed_to_host.values.keys().copied().next().unwrap(); let main_fn_symbol = exposed_to_host.values.keys().copied().next().unwrap();
if !no_check { if !no_check {
check_procedures(&arena, &interns, &layout_interner, &procedures); check_procedures(arena, &interns, &layout_interner, &procedures);
} }
verify_procedures(test_name, layout_interner, procedures, main_fn_symbol); verify_procedures(test_name, layout_interner, procedures, main_fn_symbol);