This commit is contained in:
KtorZ 2024-03-21 18:20:19 +01:00
parent ee280bc309
commit 0f9dbfd874
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
3 changed files with 30 additions and 7 deletions

View File

@ -476,9 +476,14 @@ impl<'comments> Formatter<'comments> {
let doc_comments = self.doc_comments(arg.location.start); let doc_comments = self.doc_comments(arg.location.start);
let doc = arg let doc = match &arg.annotation {
None => arg.arg_name.to_doc(),
Some(a) => arg
.arg_name .arg_name
.to_doc() .to_doc()
.append(": ")
.append(self.annotation(a)),
}
.append(" via ") .append(" via ")
.append(self.expr(&arg.via, false)) .append(self.expr(&arg.via, false))
.group(); .group();

View File

@ -744,3 +744,14 @@ fn fail_expr() {
"# "#
); );
} }
#[test]
fn fuzzer_annotations() {
assert_format!(
r#"
test foo(n: Int via int()) {
todo
}
"#
);
}

View File

@ -0,0 +1,7 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\ntest foo(n: Int via int()) {\n todo\n}\n"
---
test foo(n: Int via int()) {
todo
}