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/items | |
parent | 0b942cbcb071811a811aa35feaa80950c2415075 (diff) |
Add raw idents to lexer and parser
Diffstat (limited to 'crates/ra_syntax/src/grammar/items')
-rw-r--r-- | crates/ra_syntax/src/grammar/items/nominal.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar/items/traits.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/grammar/items/nominal.rs b/crates/ra_syntax/src/grammar/items/nominal.rs index 0784fb7b1..897306883 100644 --- a/crates/ra_syntax/src/grammar/items/nominal.rs +++ b/crates/ra_syntax/src/grammar/items/nominal.rs | |||
@@ -70,7 +70,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) { | |||
70 | } | 70 | } |
71 | let var = p.start(); | 71 | let var = p.start(); |
72 | attributes::outer_attributes(p); | 72 | attributes::outer_attributes(p); |
73 | if p.at(IDENT) { | 73 | if p.current().is_ident() { |
74 | name(p); | 74 | name(p); |
75 | match p.current() { | 75 | match p.current() { |
76 | L_CURLY => named_field_def_list(p), | 76 | L_CURLY => named_field_def_list(p), |
@@ -120,7 +120,7 @@ pub(crate) fn named_field_def_list(p: &mut Parser) { | |||
120 | // } | 120 | // } |
121 | attributes::outer_attributes(p); | 121 | attributes::outer_attributes(p); |
122 | opt_visibility(p); | 122 | opt_visibility(p); |
123 | if p.at(IDENT) { | 123 | if p.current().is_ident() { |
124 | name(p); | 124 | name(p); |
125 | p.expect(COLON); | 125 | p.expect(COLON); |
126 | types::type_(p); | 126 | types::type_(p); |
diff --git a/crates/ra_syntax/src/grammar/items/traits.rs b/crates/ra_syntax/src/grammar/items/traits.rs index 0a0621753..a78bbba2b 100644 --- a/crates/ra_syntax/src/grammar/items/traits.rs +++ b/crates/ra_syntax/src/grammar/items/traits.rs | |||
@@ -112,7 +112,7 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool { | |||
112 | if p.nth(1) == POUND || p.nth(1) == R_ANGLE { | 112 | if p.nth(1) == POUND || p.nth(1) == R_ANGLE { |
113 | return true; | 113 | return true; |
114 | } | 114 | } |
115 | (p.nth(1) == LIFETIME || p.nth(1) == IDENT) | 115 | (p.nth(1) == LIFETIME || p.nth(1).is_ident()) |
116 | && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ) | 116 | && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ) |
117 | } | 117 | } |
118 | 118 | ||