chore: re-add empty line handling by @KtorZ

Co-authored-by: KtorZ
This commit is contained in:
rvcas
2023-06-07 17:21:04 -04:00
parent 41a08e4a06
commit 3fc9c8e0db
2 changed files with 41 additions and 1 deletions

View File

@@ -3297,3 +3297,43 @@ fn parse_keyword_todo() {
],
)
}
#[test]
fn brackets_followed_by_parenthesis() {
fn assert_sequence(code: &str) {
let (module, _extra) = parser::module(code, ast::ModuleKind::Validator).unwrap();
assert!(
matches!(
module.definitions[..],
[ast::Definition::Test(Function {
body: expr::UntypedExpr::Sequence { .. },
..
})]
),
"{}",
code.to_string()
);
}
assert_sequence(indoc! {r#"
test foo () {
let a = []
(x |> y) == []
}
"#});
assert_sequence(indoc! {r#"
test foo () {
let a = []
(x |> y) == []
}
"#});
assert_sequence(indoc! {r#"
test foo () {
let a = []
// foo
(x |> y) == []
}
"#});
}