Fix more bugs

This commit is contained in:
Edwin Cheng 2019-04-25 23:12:57 +08:00
parent 299d97b6d9
commit c55a2dbc1d
8 changed files with 205 additions and 26 deletions

View file

@ -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,
}
}
}