aboutsummaryrefslogtreecommitdiff
path: root/src/grammar.ron
diff options
context:
space:
mode:
Diffstat (limited to 'src/grammar.ron')
-rw-r--r--src/grammar.ron147
1 files changed, 147 insertions, 0 deletions
diff --git a/src/grammar.ron b/src/grammar.ron
new file mode 100644
index 000000000..d5d2e6162
--- /dev/null
+++ b/src/grammar.ron
@@ -0,0 +1,147 @@
1Grammar(
2 keywords: [
3 "use",
4 "fn",
5 "struct",
6 "enum",
7 "trait",
8 "impl",
9 "true",
10 "false",
11 "as",
12 "extern",
13 "crate",
14 "mod",
15 "pub",
16 "self",
17 "super",
18 "in",
19 "where",
20 "for",
21 "loop",
22 "while",
23 "if",
24 "match",
25 "const",
26 "static",
27 "mut",
28 "unsafe",
29 "type",
30 "ref",
31 "let",
32 ],
33 contextual_keywords: [
34 "auto",
35 "default",
36 "union",
37 ],
38 tokens: [
39 "ERROR",
40 "IDENT",
41 "UNDERSCORE",
42 "WHITESPACE",
43 "INT_NUMBER",
44 "FLOAT_NUMBER",
45 "SEMI",
46 "COMMA",
47 "DOT",
48 "DOTDOT",
49 "DOTDOTDOT",
50 "DOTDOTEQ",
51 "L_PAREN",
52 "R_PAREN",
53 "L_CURLY",
54 "R_CURLY",
55 "L_BRACK",
56 "R_BRACK",
57 "L_ANGLE",
58 "R_ANGLE",
59 "AT",
60 "POUND",
61 "TILDE",
62 "QUESTION",
63 "COLON",
64 "COLONCOLON",
65 "DOLLAR",
66 "EQ",
67 "EQEQ",
68 "FAT_ARROW",
69 "NEQ",
70 "EXCL",
71 "LIFETIME",
72 "CHAR",
73 "BYTE",
74 "STRING",
75 "RAW_STRING",
76 "BYTE_STRING",
77 "RAW_BYTE_STRING",
78 "PLUS",
79 "MINUS",
80 "STAR",
81 "SLASH",
82 "CARET",
83 "PERCENT",
84 "AMPERSAND",
85 "PIPE",
86 "THIN_ARROW",
87 "COMMENT",
88 "DOC_COMMENT",
89 "SHEBANG",
90 ],
91 nodes: [
92 "FILE",
93
94 "STRUCT_ITEM",
95 "ENUM_ITEM",
96 "FN_ITEM",
97 "EXTERN_CRATE_ITEM",
98 "MOD_ITEM",
99 "USE_ITEM",
100 "STATIC_ITEM",
101 "CONST_ITEM",
102 "TRAIT_ITEM",
103 "IMPL_ITEM",
104 "TYPE_ITEM",
105
106 "PAREN_TYPE",
107 "TUPLE_TYPE",
108 "NEVER_TYPE",
109 "PATH_TYPE",
110 "POINTER_TYPE",
111 "ARRAY_TYPE",
112 "SLICE_TYPE",
113 "REFERENCE_TYPE",
114 "PLACEHOLDER_TYPE",
115 "FN_POINTER_TYPE",
116 "FOR_TYPE",
117
118 "REF_PAT",
119 "BIND_PAT",
120 "PLACEHOLDER_PAT",
121
122 "TUPLE_EXPR",
123
124 "EXTERN_BLOCK",
125 "ENUM_VARIANT",
126 "NAMED_FIELD",
127 "POS_FIELD",
128 "ATTR",
129 "META_ITEM", // not an item actually
130 "USE_TREE",
131 "PATH",
132 "PATH_SEGMENT",
133 "LITERAL",
134 "ALIAS",
135 "VISIBILITY",
136 "TYPE_PARAM_LIST",
137 "WHERE_CLAUSE",
138 "LIFETIME_PARAM",
139 "TYPE_PARAM",
140 "ABI",
141 "NAME",
142 "NAME_REF",
143 "VALUE_PARAMETER",
144 "BLOCK",
145 "LET_STMT",
146 ]
147)