aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/syntax_kinds/generated.rs.tera
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/syntax_kinds/generated.rs.tera')
-rw-r--r--crates/ra_syntax/src/syntax_kinds/generated.rs.tera23
1 files changed, 21 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/syntax_kinds/generated.rs.tera b/crates/ra_syntax/src/syntax_kinds/generated.rs.tera
index 21f9444b1..837437136 100644
--- a/crates/ra_syntax/src/syntax_kinds/generated.rs.tera
+++ b/crates/ra_syntax/src/syntax_kinds/generated.rs.tera
@@ -23,7 +23,7 @@ pub enum SyntaxKind {
23{% for kw in concat(a=keywords, b=contextual_keywords) %} 23{% for kw in concat(a=keywords, b=contextual_keywords) %}
24 {{kw | upper}}_KW, 24 {{kw | upper}}_KW,
25{%- endfor -%} 25{%- endfor -%}
26{% for t in concat(a=tokens, b=nodes) %} 26{% for t in concat(a=literals, b=tokens, c=nodes) %}
27 {{t}}, 27 {{t}},
28{%- endfor %} 28{%- endfor %}
29} 29}
@@ -40,6 +40,25 @@ impl SyntaxKind {
40 } 40 }
41 } 41 }
42 42
43 pub fn is_punct(self) -> bool {
44 match self {
45{%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %}
46 | {{t.1}}
47{%- endfor %}
48 => true,
49 _ => false
50 }
51 }
52 pub fn is_literal(self) -> bool {
53 match self {
54{%- for t in literals %}
55 | {{t}}
56{%- endfor %}
57 => true,
58 _ => false
59 }
60 }
61
43 pub(crate) fn info(self) -> &'static SyntaxInfo { 62 pub(crate) fn info(self) -> &'static SyntaxInfo {
44 match self { 63 match self {
45{%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %} 64{%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %}
@@ -48,7 +67,7 @@ impl SyntaxKind {
48{% for kw in concat(a=keywords, b=contextual_keywords) %} 67{% for kw in concat(a=keywords, b=contextual_keywords) %}
49 {{kw | upper}}_KW => &SyntaxInfo { name: "{{kw | upper}}_KW" }, 68 {{kw | upper}}_KW => &SyntaxInfo { name: "{{kw | upper}}_KW" },
50{%- endfor -%} 69{%- endfor -%}
51{% for t in concat(a=tokens, b=nodes) %} 70{% for t in concat(a=literals, b=tokens, c=nodes) %}
52 {{t}} => &SyntaxInfo { name: "{{t}}" }, 71 {{t}} => &SyntaxInfo { name: "{{t}}" },
53{%- endfor %} 72{%- endfor %}
54 TOMBSTONE => &SyntaxInfo { name: "TOMBSTONE" }, 73 TOMBSTONE => &SyntaxInfo { name: "TOMBSTONE" },