Implement parser & formatter for Pair annotations.

This commit is contained in:
KtorZ
2024-05-01 13:49:52 +02:00
committed by Kasey
parent d8d2fb0ebc
commit b1f0dfdacd
4 changed files with 55 additions and 5 deletions

View File

@@ -792,3 +792,13 @@ fn superfluous_parens_in_binop() {
"#
);
}
#[test]
fn format_pairs() {
assert_format!(
r#"
pub fn foo(x: Pair<Int, Int>) {
Pair(x.1st, x.2nd)
}"#
);
}

View File

@@ -0,0 +1,7 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\npub fn foo(x: Pair<Int, Int>) {\n Pair(x.1st, x.2nd)\n}"
---
pub fn foo(x: Pair<Int, Int>) {
Pair(x.1st, x.2nd)
}