aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/syntax_kind/generated.rs.tera
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/syntax_kind/generated.rs.tera')
-rw-r--r--crates/ra_parser/src/syntax_kind/generated.rs.tera14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs.tera b/crates/ra_parser/src/syntax_kind/generated.rs.tera
index 5b9ff21af..ccb8ca4ba 100644
--- a/crates/ra_parser/src/syntax_kind/generated.rs.tera
+++ b/crates/ra_parser/src/syntax_kind/generated.rs.tera
@@ -33,6 +33,20 @@ pub enum SyntaxKind {
33} 33}
34use self::SyntaxKind::*; 34use self::SyntaxKind::*;
35 35
36#[macro_export]
37macro_rules! T {
38{%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %}
39 {%- if t.0 == '{' or t.0 == '}' or t.0 == '[' or t.0 == ']' %}
40 ('{{t.0}}') => { $crate::SyntaxKind::{{t.1}} };
41 {%- else %}
42 ({{t.0}}) => { $crate::SyntaxKind::{{t.1}} };
43 {%- endif %}
44{%- endfor -%}
45{% for kw in concat(a=keywords, b=contextual_keywords) %}
46 ({{kw}}) => { $crate::SyntaxKind::{{kw | upper}}_KW };
47{%- endfor %}
48}
49
36impl From<u16> for SyntaxKind { 50impl From<u16> for SyntaxKind {
37 fn from(d: u16) -> SyntaxKind { 51 fn from(d: u16) -> SyntaxKind {
38 assert!(d <= (__LAST as u16)); 52 assert!(d <= (__LAST as u16));