mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Fix more bugs
This commit is contained in:
parent
299d97b6d9
commit
c55a2dbc1d
8 changed files with 205 additions and 26 deletions
|
@ -119,7 +119,22 @@ pub(crate) fn meta_item(p: &mut Parser) {
|
|||
items::token_tree(p);
|
||||
break;
|
||||
} else {
|
||||
p.bump();
|
||||
// https://doc.rust-lang.org/reference/attributes.html
|
||||
// https://doc.rust-lang.org/reference/paths.html#simple-paths
|
||||
// The start of an meta must be a simple path
|
||||
match p.current() {
|
||||
IDENT | COLONCOLON | SUPER_KW | SELF_KW | CRATE_KW => p.bump(),
|
||||
EQ => {
|
||||
p.bump();
|
||||
match p.current() {
|
||||
c if c.is_literal() => p.bump(),
|
||||
TRUE_KW | FALSE_KW => p.bump(),
|
||||
_ => {}
|
||||
}
|
||||
break;
|
||||
}
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue