diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-06 21:39:02 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-06 21:39:02 +0000 |
commit | 7f12a1f225c7d3397f27964ce039b55d680772d3 (patch) | |
tree | 26043b20588eae4510e28249f11a094aacaf190d /crates/parser/src/grammar | |
parent | cdddcaee851be1cff1eeb23599f5a58f1b30a927 (diff) | |
parent | 6158304f8b64ef7cdf58b14bc675baf33a27a853 (diff) |
Merge #6485
6485: Remove RAW literals r=matklad a=matklad
bors r+
🤖
closes https://github.com/rust-analyzer/rust-analyzer/issues/6308
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/parser/src/grammar')
-rw-r--r-- | crates/parser/src/grammar/expressions/atom.rs | 14 | ||||
-rw-r--r-- | crates/parser/src/grammar/items.rs | 4 |
2 files changed, 3 insertions, 15 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 66a92a4e1..31f42f161 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs | |||
@@ -15,18 +15,8 @@ use super::*; | |||
15 | // let _ = b"e"; | 15 | // let _ = b"e"; |
16 | // let _ = br"f"; | 16 | // let _ = br"f"; |
17 | // } | 17 | // } |
18 | pub(crate) const LITERAL_FIRST: TokenSet = TokenSet::new(&[ | 18 | pub(crate) const LITERAL_FIRST: TokenSet = |
19 | TRUE_KW, | 19 | TokenSet::new(&[TRUE_KW, FALSE_KW, INT_NUMBER, FLOAT_NUMBER, BYTE, CHAR, STRING, BYTE_STRING]); |
20 | FALSE_KW, | ||
21 | INT_NUMBER, | ||
22 | FLOAT_NUMBER, | ||
23 | BYTE, | ||
24 | CHAR, | ||
25 | STRING, | ||
26 | RAW_STRING, | ||
27 | BYTE_STRING, | ||
28 | RAW_BYTE_STRING, | ||
29 | ]); | ||
30 | 20 | ||
31 | pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> { | 21 | pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> { |
32 | if !p.at_ts(LITERAL_FIRST) { | 22 | if !p.at_ts(LITERAL_FIRST) { |
diff --git a/crates/parser/src/grammar/items.rs b/crates/parser/src/grammar/items.rs index 22810e6fb..780bc470a 100644 --- a/crates/parser/src/grammar/items.rs +++ b/crates/parser/src/grammar/items.rs | |||
@@ -239,9 +239,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> { | |||
239 | T![static] => consts::static_(p, m), | 239 | T![static] => consts::static_(p, m), |
240 | // test extern_block | 240 | // test extern_block |
241 | // extern {} | 241 | // extern {} |
242 | T![extern] | 242 | T![extern] if la == T!['{'] || (la == STRING && p.nth(2) == T!['{']) => { |
243 | if la == T!['{'] || ((la == STRING || la == RAW_STRING) && p.nth(2) == T!['{']) => | ||
244 | { | ||
245 | abi(p); | 243 | abi(p); |
246 | extern_item_list(p); | 244 | extern_item_list(p); |
247 | m.complete(p, EXTERN_BLOCK); | 245 | m.complete(p, EXTERN_BLOCK); |