Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/expressions/atom.rs')
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index 3cf9c4dd4b..d8553d3f95 100644
--- a/crates/parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
@@ -184,6 +184,16 @@ fn tuple_expr(p: &mut Parser<'_>) -> CompletedMarker {
let mut saw_comma = false;
let mut saw_expr = false;
+
+ // test_err tuple_expr_leading_comma
+ // fn foo() {
+ // (,);
+ // }
+ if p.eat(T![,]) {
+ p.error("expected expression");
+ saw_comma = true;
+ }
+
while !p.at(EOF) && !p.at(T![')']) {
saw_expr = true;