Parse attributes in tuple expressions

This commit is contained in:
Lukas Wirth 2020-12-20 21:01:36 +01:00
parent 4be9ed675e
commit 64caa027b8
3 changed files with 56 additions and 3 deletions

View file

@ -156,11 +156,13 @@ fn tuple_expr(p: &mut Parser) -> CompletedMarker {
let mut saw_expr = false;
while !p.at(EOF) && !p.at(T![')']) {
saw_expr = true;
if !p.at_ts(EXPR_FIRST) {
p.error("expected expression");
// test tuple_attrs
// const A: (i64, i64) = (1, #[cfg(test)] 2);
if !expr_with_attrs(p) {
break;
}
expr(p);
if !p.at(T![')']) {
saw_comma = true;
p.expect(T![,]);