From 3be05b1545e4b5e283aaf606143897e1a0ce56ba Mon Sep 17 00:00:00 2001 From: rvcas Date: Wed, 11 Jan 2023 19:35:36 -0500 Subject: [PATCH] fix(fmt): error fmt was removing label --- crates/aiken-lang/src/format.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/aiken-lang/src/format.rs b/crates/aiken-lang/src/format.rs index 7d485c57..8ede3abe 100644 --- a/crates/aiken-lang/src/format.rs +++ b/crates/aiken-lang/src/format.rs @@ -783,7 +783,10 @@ impl<'comments> Formatter<'comments> { .append((index + 1).to_doc()) .append(suffix) } - UntypedExpr::ErrorTerm { .. } => "error".to_doc(), + + UntypedExpr::ErrorTerm { label: None, .. } => "error".to_doc(), + + UntypedExpr::ErrorTerm { label: Some(l), .. } => docvec!["error(\"", l, "\")"], }; commented(document, comments)