mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Parse attributes in tuple expressions
This commit is contained in:
parent
4be9ed675e
commit
64caa027b8
3 changed files with 56 additions and 3 deletions
|
@ -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![,]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue