diff options
author | Josh Robson Chase <[email protected]> | 2019-01-23 17:15:47 +0000 |
---|---|---|
committer | Josh Robson Chase <[email protected]> | 2019-01-23 18:17:41 +0000 |
commit | 1cd6d6539a9d85bc44db364bb9165e6d9253790d (patch) | |
tree | 9700b48ecbf34496d45c5e08e27c113698fb1452 /crates/ra_syntax/src/grammar/expressions.rs | |
parent | 0b942cbcb071811a811aa35feaa80950c2415075 (diff) |
Add raw idents to lexer and parser
Diffstat (limited to 'crates/ra_syntax/src/grammar/expressions.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/expressions.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/grammar/expressions.rs b/crates/ra_syntax/src/grammar/expressions.rs index 2236555e0..107b7cda4 100644 --- a/crates/ra_syntax/src/grammar/expressions.rs +++ b/crates/ra_syntax/src/grammar/expressions.rs | |||
@@ -281,7 +281,7 @@ fn postfix_expr( | |||
281 | // } | 281 | // } |
282 | L_PAREN if allow_calls => call_expr(p, lhs), | 282 | L_PAREN if allow_calls => call_expr(p, lhs), |
283 | L_BRACK if allow_calls => index_expr(p, lhs), | 283 | L_BRACK if allow_calls => index_expr(p, lhs), |
284 | DOT if p.nth(1) == IDENT && (p.nth(2) == L_PAREN || p.nth(2) == COLONCOLON) => { | 284 | DOT if p.nth(1).is_ident() && (p.nth(2) == L_PAREN || p.nth(2) == COLONCOLON) => { |
285 | method_call_expr(p, lhs) | 285 | method_call_expr(p, lhs) |
286 | } | 286 | } |
287 | DOT => field_expr(p, lhs), | 287 | DOT => field_expr(p, lhs), |
@@ -332,7 +332,7 @@ fn index_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
332 | // y.bar::<T>(1, 2,); | 332 | // y.bar::<T>(1, 2,); |
333 | // } | 333 | // } |
334 | fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | 334 | fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { |
335 | assert!(p.at(DOT) && p.nth(1) == IDENT && (p.nth(2) == L_PAREN || p.nth(2) == COLONCOLON)); | 335 | assert!(p.at(DOT) && p.nth(1).is_ident() && (p.nth(2) == L_PAREN || p.nth(2) == COLONCOLON)); |
336 | let m = lhs.precede(p); | 336 | let m = lhs.precede(p); |
337 | p.bump(); | 337 | p.bump(); |
338 | name_ref(p); | 338 | name_ref(p); |
@@ -352,7 +352,7 @@ fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
352 | assert!(p.at(DOT)); | 352 | assert!(p.at(DOT)); |
353 | let m = lhs.precede(p); | 353 | let m = lhs.precede(p); |
354 | p.bump(); | 354 | p.bump(); |
355 | if p.at(IDENT) { | 355 | if p.current().is_ident() { |
356 | name_ref(p) | 356 | name_ref(p) |
357 | } else if p.at(INT_NUMBER) { | 357 | } else if p.at(INT_NUMBER) { |
358 | p.bump() | 358 | p.bump() |
@@ -443,7 +443,7 @@ pub(crate) fn named_field_list(p: &mut Parser) { | |||
443 | p.bump(); | 443 | p.bump(); |
444 | while !p.at(EOF) && !p.at(R_CURLY) { | 444 | while !p.at(EOF) && !p.at(R_CURLY) { |
445 | match p.current() { | 445 | match p.current() { |
446 | IDENT => { | 446 | IDENT | RAW_IDENT => { |
447 | let m = p.start(); | 447 | let m = p.start(); |
448 | name_ref(p); | 448 | name_ref(p); |
449 | if p.eat(COLON) { | 449 | if p.eat(COLON) { |