diff options
author | Edwin Cheng <[email protected]> | 2019-04-25 16:12:57 +0100 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-04-25 19:03:56 +0100 |
commit | c55a2dbc1de8ba42df57b70f652eb6a0c0bbc9f6 (patch) | |
tree | 082cbca15c8af95ea0be73319a9ac00e45ba5cf1 /crates/ra_parser | |
parent | 299d97b6d98cec673ff056c188ac45a17febc7d4 (diff) |
Fix more bugs
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 67eae749d..a538ec081 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -119,7 +119,22 @@ pub(crate) fn meta_item(p: &mut Parser) { | |||
119 | items::token_tree(p); | 119 | items::token_tree(p); |
120 | break; | 120 | break; |
121 | } else { | 121 | } else { |
122 | p.bump(); | 122 | // https://doc.rust-lang.org/reference/attributes.html |
123 | // https://doc.rust-lang.org/reference/paths.html#simple-paths | ||
124 | // The start of an meta must be a simple path | ||
125 | match p.current() { | ||
126 | IDENT | COLONCOLON | SUPER_KW | SELF_KW | CRATE_KW => p.bump(), | ||
127 | EQ => { | ||
128 | p.bump(); | ||
129 | match p.current() { | ||
130 | c if c.is_literal() => p.bump(), | ||
131 | TRUE_KW | FALSE_KW => p.bump(), | ||
132 | _ => {} | ||
133 | } | ||
134 | break; | ||
135 | } | ||
136 | _ => break, | ||
137 | } | ||
123 | } | 138 | } |
124 | } | 139 | } |
125 | 140 | ||