From 1cd6d6539a9d85bc44db364bb9165e6d9253790d Mon Sep 17 00:00:00 2001 From: Josh Robson Chase Date: Wed, 23 Jan 2019 12:15:47 -0500 Subject: Add raw idents to lexer and parser --- crates/ra_syntax/src/grammar/items/nominal.rs | 4 ++-- crates/ra_syntax/src/grammar/items/traits.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_syntax/src/grammar/items') 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) { } let var = p.start(); attributes::outer_attributes(p); - if p.at(IDENT) { + if p.current().is_ident() { name(p); match p.current() { L_CURLY => named_field_def_list(p), @@ -120,7 +120,7 @@ pub(crate) fn named_field_def_list(p: &mut Parser) { // } attributes::outer_attributes(p); opt_visibility(p); - if p.at(IDENT) { + if p.current().is_ident() { name(p); p.expect(COLON); 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 { if p.nth(1) == POUND || p.nth(1) == R_ANGLE { return true; } - (p.nth(1) == LIFETIME || p.nth(1) == IDENT) + (p.nth(1) == LIFETIME || p.nth(1).is_ident()) && (p.nth(2) == R_ANGLE || p.nth(2) == COMMA || p.nth(2) == COLON || p.nth(2) == EQ) } -- cgit v1.2.3