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/syntax_kinds | |
parent | 0b942cbcb071811a811aa35feaa80950c2415075 (diff) |
Add raw idents to lexer and parser
Diffstat (limited to 'crates/ra_syntax/src/syntax_kinds')
-rw-r--r-- | crates/ra_syntax/src/syntax_kinds/generated.rs | 10 | ||||
-rw-r--r-- | crates/ra_syntax/src/syntax_kinds/generated.rs.tera | 9 |
2 files changed, 19 insertions, 0 deletions
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 { | |||
105 | UNION_KW, | 105 | UNION_KW, |
106 | ERROR, | 106 | ERROR, |
107 | IDENT, | 107 | IDENT, |
108 | RAW_IDENT, | ||
108 | UNDERSCORE, | 109 | UNDERSCORE, |
109 | WHITESPACE, | 110 | WHITESPACE, |
110 | INT_NUMBER, | 111 | INT_NUMBER, |
@@ -368,6 +369,7 @@ impl SyntaxKind { | |||
368 | UNION_KW => &SyntaxInfo { name: "UNION_KW" }, | 369 | UNION_KW => &SyntaxInfo { name: "UNION_KW" }, |
369 | ERROR => &SyntaxInfo { name: "ERROR" }, | 370 | ERROR => &SyntaxInfo { name: "ERROR" }, |
370 | IDENT => &SyntaxInfo { name: "IDENT" }, | 371 | IDENT => &SyntaxInfo { name: "IDENT" }, |
372 | RAW_IDENT => &SyntaxInfo { name: "RAW_IDENT" }, | ||
371 | UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" }, | 373 | UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" }, |
372 | WHITESPACE => &SyntaxInfo { name: "WHITESPACE" }, | 374 | WHITESPACE => &SyntaxInfo { name: "WHITESPACE" }, |
373 | INT_NUMBER => &SyntaxInfo { name: "INT_NUMBER" }, | 375 | INT_NUMBER => &SyntaxInfo { name: "INT_NUMBER" }, |
@@ -563,4 +565,12 @@ impl SyntaxKind { | |||
563 | }; | 565 | }; |
564 | Some(tok) | 566 | Some(tok) |
565 | } | 567 | } |
568 | |||
569 | pub(crate) fn is_ident(&self) -> bool { | ||
570 | match self { | ||
571 | | IDENT | ||
572 | | RAW_IDENT => true, | ||
573 | _ => false, | ||
574 | } | ||
575 | } | ||
566 | } | 576 | } |
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 { | |||
74 | }; | 74 | }; |
75 | Some(tok) | 75 | Some(tok) |
76 | } | 76 | } |
77 | |||
78 | pub(crate) fn is_ident(&self) -> bool { | ||
79 | match self { | ||
80 | {%- for kind in ident_tokens %} | ||
81 | | {{kind}} | ||
82 | {%- endfor %} => true, | ||
83 | _ => false, | ||
84 | } | ||
85 | } | ||
77 | } | 86 | } |