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/syntax_kinds/generated.rs | 10 ++++++++++ crates/ra_syntax/src/syntax_kinds/generated.rs.tera | 9 +++++++++ 2 files changed, 19 insertions(+) (limited to 'crates/ra_syntax/src/syntax_kinds') diff --git a/crates/ra_syntax/src/syntax_kinds/generated.rs b/crates/ra_syntax/src/syntax_kinds/generated.rs index 06faf7557..aa1ab3326 100644 --- a/crates/ra_syntax/src/syntax_kinds/generated.rs +++ b/crates/ra_syntax/src/syntax_kinds/generated.rs @@ -105,6 +105,7 @@ pub enum SyntaxKind { UNION_KW, ERROR, IDENT, + RAW_IDENT, UNDERSCORE, WHITESPACE, INT_NUMBER, @@ -368,6 +369,7 @@ impl SyntaxKind { UNION_KW => &SyntaxInfo { name: "UNION_KW" }, ERROR => &SyntaxInfo { name: "ERROR" }, IDENT => &SyntaxInfo { name: "IDENT" }, + RAW_IDENT => &SyntaxInfo { name: "RAW_IDENT" }, UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" }, WHITESPACE => &SyntaxInfo { name: "WHITESPACE" }, INT_NUMBER => &SyntaxInfo { name: "INT_NUMBER" }, @@ -563,4 +565,12 @@ impl SyntaxKind { }; Some(tok) } + + pub(crate) fn is_ident(&self) -> bool { + match self { + | IDENT + | RAW_IDENT => true, + _ => false, + } + } } diff --git a/crates/ra_syntax/src/syntax_kinds/generated.rs.tera b/crates/ra_syntax/src/syntax_kinds/generated.rs.tera index 21f9444b1..83787f820 100644 --- a/crates/ra_syntax/src/syntax_kinds/generated.rs.tera +++ b/crates/ra_syntax/src/syntax_kinds/generated.rs.tera @@ -74,4 +74,13 @@ impl SyntaxKind { }; Some(tok) } + + pub(crate) fn is_ident(&self) -> bool { + match self { +{%- for kind in ident_tokens %} + | {{kind}} +{%- endfor %} => true, + _ => false, + } + } } -- cgit v1.2.3