mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Kill RAW_ literals
Syntactically, they are indistinguishable from non-raw versions, so it doesn't make sense to separate then *at the syntax* level.
This commit is contained in:
parent
6725dcf847
commit
5ba4f949c2
53 changed files with 142 additions and 165 deletions
|
@ -15,18 +15,8 @@ use super::*;
|
|||
// let _ = b"e";
|
||||
// let _ = br"f";
|
||||
// }
|
||||
pub(crate) const LITERAL_FIRST: TokenSet = TokenSet::new(&[
|
||||
TRUE_KW,
|
||||
FALSE_KW,
|
||||
INT_NUMBER,
|
||||
FLOAT_NUMBER,
|
||||
BYTE,
|
||||
CHAR,
|
||||
STRING,
|
||||
RAW_STRING,
|
||||
BYTE_STRING,
|
||||
RAW_BYTE_STRING,
|
||||
]);
|
||||
pub(crate) const LITERAL_FIRST: TokenSet =
|
||||
TokenSet::new(&[TRUE_KW, FALSE_KW, INT_NUMBER, FLOAT_NUMBER, BYTE, CHAR, STRING, BYTE_STRING]);
|
||||
|
||||
pub(crate) fn literal(p: &mut Parser) -> Option<CompletedMarker> {
|
||||
if !p.at_ts(LITERAL_FIRST) {
|
||||
|
|
|
@ -239,9 +239,7 @@ fn items_without_modifiers(p: &mut Parser, m: Marker) -> Result<(), Marker> {
|
|||
T![static] => consts::static_(p, m),
|
||||
// test extern_block
|
||||
// extern {}
|
||||
T![extern]
|
||||
if la == T!['{'] || ((la == STRING || la == RAW_STRING) && p.nth(2) == T!['{']) =>
|
||||
{
|
||||
T![extern] if la == T!['{'] || (la == STRING && p.nth(2) == T!['{']) => {
|
||||
abi(p);
|
||||
extern_item_list(p);
|
||||
m.complete(p, EXTERN_BLOCK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue