1#[allow(dead_code)]
4#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
5pub enum NonTerminalKind {
6 Array,
7 ArrayBegin,
8 ArrayElements,
9 ArrayElementsOpt,
10 ArrayElementsTail,
11 ArrayElementsTailOpt,
12 ArrayEnd,
13 ArrayMarker,
14 ArrayMarkerOpt,
15 ArrayOpt,
16 At,
17 Backtick2,
18 Backtick3,
19 Backtick4,
20 Backtick5,
21 BacktickDelim,
22 Begin,
23 Bind,
24 Binding,
25 BindingRhs,
26 Boolean,
27 CodeBlock,
28 CodeBlock3,
29 CodeBlock3List,
30 CodeBlock3ListGroup,
31 CodeBlock4,
32 CodeBlock4List,
33 CodeBlock4ListGroup,
34 CodeBlock5,
35 CodeBlock5List,
36 CodeBlock5ListGroup,
37 CodeBlock6,
38 CodeBlock6List,
39 CodeBlock6ListGroup,
40 CodeBlockEnd3,
41 CodeBlockEnd4,
42 CodeBlockEnd5,
43 CodeBlockEnd6,
44 CodeBlockStart3,
45 CodeBlockStart4,
46 CodeBlockStart5,
47 CodeBlockStart6,
48 Comma,
49 Continue,
50 DelimCode,
51 DelimCode1,
52 DelimCode1List,
53 DelimCode1ListGroup,
54 DelimCode2,
55 DelimCode2List,
56 DelimCode2ListGroup,
57 DelimCode3,
58 DelimCode3List,
59 DelimCode3ListGroup,
60 DelimCodeEnd1,
61 DelimCodeEnd2,
62 DelimCodeEnd3,
63 DelimCodeStart1,
64 DelimCodeStart2,
65 DelimCodeStart3,
66 Dot,
67 End,
68 Eure,
69 EureList,
70 EureList0,
71 EureOpt,
72 Ext,
73 ExtensionNameSpace,
74 False,
75 Float,
76 GrammarNewline,
77 Hole,
78 Ident,
79 Inf,
80 InlineCode,
81 InlineCode1,
82 Integer,
83 Key,
84 KeyBase,
85 KeyIdent,
86 KeyOpt,
87 KeyTuple,
88 KeyTupleElements,
89 KeyTupleElementsOpt,
90 KeyTupleElementsTail,
91 KeyTupleElementsTailOpt,
92 KeyTupleOpt,
93 KeyValue,
94 Keys,
95 KeysList,
96 LParen,
97 LitStr,
98 LitStr1,
99 LitStr1End,
100 LitStr1List,
101 LitStr1ListGroup,
102 LitStr1Start,
103 LitStr2,
104 LitStr2End,
105 LitStr2List,
106 LitStr2ListGroup,
107 LitStr2Start,
108 LitStr3,
109 LitStr3End,
110 LitStr3List,
111 LitStr3ListGroup,
112 LitStr3Start,
113 MapBind,
114 NaN,
115 NoBacktick,
116 NoSQuote,
117 Null,
118 Number,
119 Object,
120 ObjectList,
121 ObjectOpt,
122 ObjectOpt0,
123 ObjectOpt1,
124 RParen,
125 RootBinding,
126 SQuote,
127 Section,
128 SectionBinding,
129 SectionBody,
130 SectionBodyList,
131 SectionBodyOpt,
132 Str,
133 String,
134 Strings,
135 StringsList,
136 Text,
137 TextBinding,
138 TextBindingOpt,
139 TextBindingOpt0,
140 TextBindingOpt1,
141 TextStart,
142 True,
143 Tuple,
144 TupleElements,
145 TupleElementsOpt,
146 TupleElementsTail,
147 TupleElementsTailOpt,
148 TupleIndex,
149 TupleOpt,
150 Value,
151 ValueBinding,
152 Ws,
153 Root,
154}
155#[allow(dead_code)]
156#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
157pub enum TerminalKind {
158 NewLine,
159 Whitespace,
160 LineComment,
161 BlockComment,
162 Hash,
163 MapBind,
164 Integer,
165 Float,
166 Inf,
167 NaN,
168 True,
169 False,
170 Null,
171 Hole,
172 Str,
173 LitStr,
174 Text,
175 InlineCode1,
176 LitStr3Start,
177 LitStr2Start,
178 LitStr1Start,
179 DelimCodeStart3,
180 DelimCodeStart2,
181 DelimCodeStart1,
182 CodeBlockStart3,
183 CodeBlockStart4,
184 CodeBlockStart5,
185 CodeBlockStart6,
186 CodeBlockEnd3,
187 Backtick2,
188 CodeBlockEnd4,
189 Backtick3,
190 CodeBlockEnd5,
191 Backtick4,
192 CodeBlockEnd6,
193 Backtick5,
194 NoBacktick,
195 LitStr3End,
196 LitStr2End,
197 LitStr1End,
198 SQuote,
199 NoSQuote,
200 DelimCodeEnd3,
201 DelimCodeEnd2,
202 DelimCodeEnd1,
203 BacktickDelim,
204 GrammarNewline,
205 Ws,
206 At,
207 Dollar,
208 Dot,
209 LBrace,
210 RBrace,
211 LBracket,
212 RBracket,
213 LParen,
214 RParen,
215 Bind,
216 Comma,
217 Esc,
218 TextStart,
219 Ident,
220}
221#[allow(dead_code)]
222impl TerminalKind {
223 pub fn from_terminal_index(index: u16) -> Self {
224 match index {
225 1 => Self::NewLine,
226 2 => Self::Whitespace,
227 3 => Self::LineComment,
228 4 => Self::BlockComment,
229 5 => Self::Hash,
230 6 => Self::MapBind,
231 7 => Self::Integer,
232 8 => Self::Float,
233 9 => Self::Inf,
234 10 => Self::NaN,
235 11 => Self::True,
236 12 => Self::False,
237 13 => Self::Null,
238 14 => Self::Hole,
239 15 => Self::Str,
240 16 => Self::LitStr,
241 17 => Self::Text,
242 18 => Self::InlineCode1,
243 19 => Self::LitStr3Start,
244 20 => Self::LitStr2Start,
245 21 => Self::LitStr1Start,
246 22 => Self::DelimCodeStart3,
247 23 => Self::DelimCodeStart2,
248 24 => Self::DelimCodeStart1,
249 25 => Self::CodeBlockStart3,
250 26 => Self::CodeBlockStart4,
251 27 => Self::CodeBlockStart5,
252 28 => Self::CodeBlockStart6,
253 29 => Self::CodeBlockEnd3,
254 30 => Self::Backtick2,
255 31 => Self::CodeBlockEnd4,
256 32 => Self::Backtick3,
257 33 => Self::CodeBlockEnd5,
258 34 => Self::Backtick4,
259 35 => Self::CodeBlockEnd6,
260 36 => Self::Backtick5,
261 37 => Self::NoBacktick,
262 38 => Self::LitStr3End,
263 39 => Self::LitStr2End,
264 40 => Self::LitStr1End,
265 41 => Self::SQuote,
266 42 => Self::NoSQuote,
267 43 => Self::DelimCodeEnd3,
268 44 => Self::DelimCodeEnd2,
269 45 => Self::DelimCodeEnd1,
270 46 => Self::BacktickDelim,
271 47 => Self::GrammarNewline,
272 48 => Self::Ws,
273 49 => Self::At,
274 50 => Self::Dollar,
275 51 => Self::Dot,
276 52 => Self::LBrace,
277 53 => Self::RBrace,
278 54 => Self::LBracket,
279 55 => Self::RBracket,
280 56 => Self::LParen,
281 57 => Self::RParen,
282 58 => Self::Bind,
283 59 => Self::Comma,
284 60 => Self::Esc,
285 61 => Self::TextStart,
286 62 => Self::Ident,
287 _ => panic!("Invalid terminal index: {}", index),
288 }
289 }
290 pub fn is_builtin_terminal(&self) -> bool {
291 matches!(
292 self,
293 TerminalKind::NewLine
294 | TerminalKind::Whitespace
295 | TerminalKind::LineComment
296 | TerminalKind::BlockComment
297 )
298 }
299 pub fn is_builtin_new_line(&self) -> bool {
300 matches!(self, TerminalKind::NewLine)
301 }
302 pub fn is_builtin_whitespace(&self) -> bool {
303 matches!(self, TerminalKind::Whitespace)
304 }
305 pub fn is_builtin_line_comment(&self) -> bool {
306 matches!(self, TerminalKind::LineComment)
307 }
308 pub fn is_builtin_block_comment(&self) -> bool {
309 matches!(self, TerminalKind::BlockComment)
310 }
311}
312
313#[allow(dead_code)]
314impl NonTerminalKind {
315 pub fn from_non_terminal_name(name: &str) -> Self {
316 match name {
317 "Array" => Self::Array,
318 "ArrayBegin" => Self::ArrayBegin,
319 "ArrayElements" => Self::ArrayElements,
320 "ArrayElementsOpt" => Self::ArrayElementsOpt,
321 "ArrayElementsTail" => Self::ArrayElementsTail,
322 "ArrayElementsTailOpt" => Self::ArrayElementsTailOpt,
323 "ArrayEnd" => Self::ArrayEnd,
324 "ArrayMarker" => Self::ArrayMarker,
325 "ArrayMarkerOpt" => Self::ArrayMarkerOpt,
326 "ArrayOpt" => Self::ArrayOpt,
327 "At" => Self::At,
328 "Backtick2" => Self::Backtick2,
329 "Backtick3" => Self::Backtick3,
330 "Backtick4" => Self::Backtick4,
331 "Backtick5" => Self::Backtick5,
332 "BacktickDelim" => Self::BacktickDelim,
333 "Begin" => Self::Begin,
334 "Bind" => Self::Bind,
335 "Binding" => Self::Binding,
336 "BindingRhs" => Self::BindingRhs,
337 "Boolean" => Self::Boolean,
338 "CodeBlock" => Self::CodeBlock,
339 "CodeBlock3" => Self::CodeBlock3,
340 "CodeBlock3List" => Self::CodeBlock3List,
341 "CodeBlock3ListGroup" => Self::CodeBlock3ListGroup,
342 "CodeBlock4" => Self::CodeBlock4,
343 "CodeBlock4List" => Self::CodeBlock4List,
344 "CodeBlock4ListGroup" => Self::CodeBlock4ListGroup,
345 "CodeBlock5" => Self::CodeBlock5,
346 "CodeBlock5List" => Self::CodeBlock5List,
347 "CodeBlock5ListGroup" => Self::CodeBlock5ListGroup,
348 "CodeBlock6" => Self::CodeBlock6,
349 "CodeBlock6List" => Self::CodeBlock6List,
350 "CodeBlock6ListGroup" => Self::CodeBlock6ListGroup,
351 "CodeBlockEnd3" => Self::CodeBlockEnd3,
352 "CodeBlockEnd4" => Self::CodeBlockEnd4,
353 "CodeBlockEnd5" => Self::CodeBlockEnd5,
354 "CodeBlockEnd6" => Self::CodeBlockEnd6,
355 "CodeBlockStart3" => Self::CodeBlockStart3,
356 "CodeBlockStart4" => Self::CodeBlockStart4,
357 "CodeBlockStart5" => Self::CodeBlockStart5,
358 "CodeBlockStart6" => Self::CodeBlockStart6,
359 "Comma" => Self::Comma,
360 "Continue" => Self::Continue,
361 "DelimCode" => Self::DelimCode,
362 "DelimCode1" => Self::DelimCode1,
363 "DelimCode1List" => Self::DelimCode1List,
364 "DelimCode1ListGroup" => Self::DelimCode1ListGroup,
365 "DelimCode2" => Self::DelimCode2,
366 "DelimCode2List" => Self::DelimCode2List,
367 "DelimCode2ListGroup" => Self::DelimCode2ListGroup,
368 "DelimCode3" => Self::DelimCode3,
369 "DelimCode3List" => Self::DelimCode3List,
370 "DelimCode3ListGroup" => Self::DelimCode3ListGroup,
371 "DelimCodeEnd1" => Self::DelimCodeEnd1,
372 "DelimCodeEnd2" => Self::DelimCodeEnd2,
373 "DelimCodeEnd3" => Self::DelimCodeEnd3,
374 "DelimCodeStart1" => Self::DelimCodeStart1,
375 "DelimCodeStart2" => Self::DelimCodeStart2,
376 "DelimCodeStart3" => Self::DelimCodeStart3,
377 "Dot" => Self::Dot,
378 "End" => Self::End,
379 "Eure" => Self::Eure,
380 "EureList" => Self::EureList,
381 "EureList0" => Self::EureList0,
382 "EureOpt" => Self::EureOpt,
383 "Ext" => Self::Ext,
384 "ExtensionNameSpace" => Self::ExtensionNameSpace,
385 "False" => Self::False,
386 "Float" => Self::Float,
387 "GrammarNewline" => Self::GrammarNewline,
388 "Hole" => Self::Hole,
389 "Ident" => Self::Ident,
390 "Inf" => Self::Inf,
391 "InlineCode" => Self::InlineCode,
392 "InlineCode1" => Self::InlineCode1,
393 "Integer" => Self::Integer,
394 "Key" => Self::Key,
395 "KeyBase" => Self::KeyBase,
396 "KeyIdent" => Self::KeyIdent,
397 "KeyOpt" => Self::KeyOpt,
398 "KeyTuple" => Self::KeyTuple,
399 "KeyTupleElements" => Self::KeyTupleElements,
400 "KeyTupleElementsOpt" => Self::KeyTupleElementsOpt,
401 "KeyTupleElementsTail" => Self::KeyTupleElementsTail,
402 "KeyTupleElementsTailOpt" => Self::KeyTupleElementsTailOpt,
403 "KeyTupleOpt" => Self::KeyTupleOpt,
404 "KeyValue" => Self::KeyValue,
405 "Keys" => Self::Keys,
406 "KeysList" => Self::KeysList,
407 "LParen" => Self::LParen,
408 "LitStr" => Self::LitStr,
409 "LitStr1" => Self::LitStr1,
410 "LitStr1End" => Self::LitStr1End,
411 "LitStr1List" => Self::LitStr1List,
412 "LitStr1ListGroup" => Self::LitStr1ListGroup,
413 "LitStr1Start" => Self::LitStr1Start,
414 "LitStr2" => Self::LitStr2,
415 "LitStr2End" => Self::LitStr2End,
416 "LitStr2List" => Self::LitStr2List,
417 "LitStr2ListGroup" => Self::LitStr2ListGroup,
418 "LitStr2Start" => Self::LitStr2Start,
419 "LitStr3" => Self::LitStr3,
420 "LitStr3End" => Self::LitStr3End,
421 "LitStr3List" => Self::LitStr3List,
422 "LitStr3ListGroup" => Self::LitStr3ListGroup,
423 "LitStr3Start" => Self::LitStr3Start,
424 "MapBind" => Self::MapBind,
425 "NaN" => Self::NaN,
426 "NoBacktick" => Self::NoBacktick,
427 "NoSQuote" => Self::NoSQuote,
428 "Null" => Self::Null,
429 "Number" => Self::Number,
430 "Object" => Self::Object,
431 "ObjectList" => Self::ObjectList,
432 "ObjectOpt" => Self::ObjectOpt,
433 "ObjectOpt0" => Self::ObjectOpt0,
434 "ObjectOpt1" => Self::ObjectOpt1,
435 "RParen" => Self::RParen,
436 "RootBinding" => Self::RootBinding,
437 "SQuote" => Self::SQuote,
438 "Section" => Self::Section,
439 "SectionBinding" => Self::SectionBinding,
440 "SectionBody" => Self::SectionBody,
441 "SectionBodyList" => Self::SectionBodyList,
442 "SectionBodyOpt" => Self::SectionBodyOpt,
443 "Str" => Self::Str,
444 "String" => Self::String,
445 "Strings" => Self::Strings,
446 "StringsList" => Self::StringsList,
447 "Text" => Self::Text,
448 "TextBinding" => Self::TextBinding,
449 "TextBindingOpt" => Self::TextBindingOpt,
450 "TextBindingOpt0" => Self::TextBindingOpt0,
451 "TextBindingOpt1" => Self::TextBindingOpt1,
452 "TextStart" => Self::TextStart,
453 "True" => Self::True,
454 "Tuple" => Self::Tuple,
455 "TupleElements" => Self::TupleElements,
456 "TupleElementsOpt" => Self::TupleElementsOpt,
457 "TupleElementsTail" => Self::TupleElementsTail,
458 "TupleElementsTailOpt" => Self::TupleElementsTailOpt,
459 "TupleIndex" => Self::TupleIndex,
460 "TupleOpt" => Self::TupleOpt,
461 "Value" => Self::Value,
462 "ValueBinding" => Self::ValueBinding,
463 "Ws" => Self::Ws,
464 "" => Self::Root,
465 _ => panic!("Invalid non-terminal name: {}", name),
466 }
467 }
468}
469impl std::fmt::Display for TerminalKind {
470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
471 match self {
472 Self::NewLine => write!(f, stringify!(NewLine)),
473 Self::Whitespace => write!(f, stringify!(Whitespace)),
474 Self::LineComment => write!(f, stringify!(LineComment)),
475 Self::BlockComment => write!(f, stringify!(BlockComment)),
476 Self::Hash => write!(f, stringify!(Hash)),
477 Self::MapBind => write!(f, stringify!(MapBind)),
478 Self::Integer => write!(f, stringify!(Integer)),
479 Self::Float => write!(f, stringify!(Float)),
480 Self::Inf => write!(f, stringify!(Inf)),
481 Self::NaN => write!(f, stringify!(NaN)),
482 Self::True => write!(f, stringify!(True)),
483 Self::False => write!(f, stringify!(False)),
484 Self::Null => write!(f, stringify!(Null)),
485 Self::Hole => write!(f, stringify!(Hole)),
486 Self::Str => write!(f, stringify!(Str)),
487 Self::LitStr => write!(f, stringify!(LitStr)),
488 Self::Text => write!(f, stringify!(Text)),
489 Self::InlineCode1 => write!(f, stringify!(InlineCode1)),
490 Self::LitStr3Start => write!(f, stringify!(LitStr3Start)),
491 Self::LitStr2Start => write!(f, stringify!(LitStr2Start)),
492 Self::LitStr1Start => write!(f, stringify!(LitStr1Start)),
493 Self::DelimCodeStart3 => write!(f, stringify!(DelimCodeStart3)),
494 Self::DelimCodeStart2 => write!(f, stringify!(DelimCodeStart2)),
495 Self::DelimCodeStart1 => write!(f, stringify!(DelimCodeStart1)),
496 Self::CodeBlockStart3 => write!(f, stringify!(CodeBlockStart3)),
497 Self::CodeBlockStart4 => write!(f, stringify!(CodeBlockStart4)),
498 Self::CodeBlockStart5 => write!(f, stringify!(CodeBlockStart5)),
499 Self::CodeBlockStart6 => write!(f, stringify!(CodeBlockStart6)),
500 Self::CodeBlockEnd3 => write!(f, stringify!(CodeBlockEnd3)),
501 Self::Backtick2 => write!(f, stringify!(Backtick2)),
502 Self::CodeBlockEnd4 => write!(f, stringify!(CodeBlockEnd4)),
503 Self::Backtick3 => write!(f, stringify!(Backtick3)),
504 Self::CodeBlockEnd5 => write!(f, stringify!(CodeBlockEnd5)),
505 Self::Backtick4 => write!(f, stringify!(Backtick4)),
506 Self::CodeBlockEnd6 => write!(f, stringify!(CodeBlockEnd6)),
507 Self::Backtick5 => write!(f, stringify!(Backtick5)),
508 Self::NoBacktick => write!(f, stringify!(NoBacktick)),
509 Self::LitStr3End => write!(f, stringify!(LitStr3End)),
510 Self::LitStr2End => write!(f, stringify!(LitStr2End)),
511 Self::LitStr1End => write!(f, stringify!(LitStr1End)),
512 Self::SQuote => write!(f, stringify!(SQuote)),
513 Self::NoSQuote => write!(f, stringify!(NoSQuote)),
514 Self::DelimCodeEnd3 => write!(f, stringify!(DelimCodeEnd3)),
515 Self::DelimCodeEnd2 => write!(f, stringify!(DelimCodeEnd2)),
516 Self::DelimCodeEnd1 => write!(f, stringify!(DelimCodeEnd1)),
517 Self::BacktickDelim => write!(f, stringify!(BacktickDelim)),
518 Self::GrammarNewline => write!(f, stringify!(GrammarNewline)),
519 Self::Ws => write!(f, stringify!(Ws)),
520 Self::At => write!(f, stringify!(At)),
521 Self::Dollar => write!(f, stringify!(Dollar)),
522 Self::Dot => write!(f, stringify!(Dot)),
523 Self::LBrace => write!(f, stringify!(LBrace)),
524 Self::RBrace => write!(f, stringify!(RBrace)),
525 Self::LBracket => write!(f, stringify!(LBracket)),
526 Self::RBracket => write!(f, stringify!(RBracket)),
527 Self::LParen => write!(f, stringify!(LParen)),
528 Self::RParen => write!(f, stringify!(RParen)),
529 Self::Bind => write!(f, stringify!(Bind)),
530 Self::Comma => write!(f, stringify!(Comma)),
531 Self::Esc => write!(f, stringify!(Esc)),
532 Self::TextStart => write!(f, stringify!(TextStart)),
533 Self::Ident => write!(f, stringify!(Ident)),
534 }
535 }
536}
537
538impl std::fmt::Display for NonTerminalKind {
539 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
540 match self {
541 Self::Array => write!(f, stringify!(Array)),
542 Self::ArrayBegin => write!(f, stringify!(ArrayBegin)),
543 Self::ArrayElements => write!(f, stringify!(ArrayElements)),
544 Self::ArrayElementsOpt => write!(f, stringify!(ArrayElementsOpt)),
545 Self::ArrayElementsTail => write!(f, stringify!(ArrayElementsTail)),
546 Self::ArrayElementsTailOpt => write!(f, stringify!(ArrayElementsTailOpt)),
547 Self::ArrayEnd => write!(f, stringify!(ArrayEnd)),
548 Self::ArrayMarker => write!(f, stringify!(ArrayMarker)),
549 Self::ArrayMarkerOpt => write!(f, stringify!(ArrayMarkerOpt)),
550 Self::ArrayOpt => write!(f, stringify!(ArrayOpt)),
551 Self::At => write!(f, stringify!(At)),
552 Self::Backtick2 => write!(f, stringify!(Backtick2)),
553 Self::Backtick3 => write!(f, stringify!(Backtick3)),
554 Self::Backtick4 => write!(f, stringify!(Backtick4)),
555 Self::Backtick5 => write!(f, stringify!(Backtick5)),
556 Self::BacktickDelim => write!(f, stringify!(BacktickDelim)),
557 Self::Begin => write!(f, stringify!(Begin)),
558 Self::Bind => write!(f, stringify!(Bind)),
559 Self::Binding => write!(f, stringify!(Binding)),
560 Self::BindingRhs => write!(f, stringify!(BindingRhs)),
561 Self::Boolean => write!(f, stringify!(Boolean)),
562 Self::CodeBlock => write!(f, stringify!(CodeBlock)),
563 Self::CodeBlock3 => write!(f, stringify!(CodeBlock3)),
564 Self::CodeBlock3List => write!(f, stringify!(CodeBlock3List)),
565 Self::CodeBlock3ListGroup => write!(f, stringify!(CodeBlock3ListGroup)),
566 Self::CodeBlock4 => write!(f, stringify!(CodeBlock4)),
567 Self::CodeBlock4List => write!(f, stringify!(CodeBlock4List)),
568 Self::CodeBlock4ListGroup => write!(f, stringify!(CodeBlock4ListGroup)),
569 Self::CodeBlock5 => write!(f, stringify!(CodeBlock5)),
570 Self::CodeBlock5List => write!(f, stringify!(CodeBlock5List)),
571 Self::CodeBlock5ListGroup => write!(f, stringify!(CodeBlock5ListGroup)),
572 Self::CodeBlock6 => write!(f, stringify!(CodeBlock6)),
573 Self::CodeBlock6List => write!(f, stringify!(CodeBlock6List)),
574 Self::CodeBlock6ListGroup => write!(f, stringify!(CodeBlock6ListGroup)),
575 Self::CodeBlockEnd3 => write!(f, stringify!(CodeBlockEnd3)),
576 Self::CodeBlockEnd4 => write!(f, stringify!(CodeBlockEnd4)),
577 Self::CodeBlockEnd5 => write!(f, stringify!(CodeBlockEnd5)),
578 Self::CodeBlockEnd6 => write!(f, stringify!(CodeBlockEnd6)),
579 Self::CodeBlockStart3 => write!(f, stringify!(CodeBlockStart3)),
580 Self::CodeBlockStart4 => write!(f, stringify!(CodeBlockStart4)),
581 Self::CodeBlockStart5 => write!(f, stringify!(CodeBlockStart5)),
582 Self::CodeBlockStart6 => write!(f, stringify!(CodeBlockStart6)),
583 Self::Comma => write!(f, stringify!(Comma)),
584 Self::Continue => write!(f, stringify!(Continue)),
585 Self::DelimCode => write!(f, stringify!(DelimCode)),
586 Self::DelimCode1 => write!(f, stringify!(DelimCode1)),
587 Self::DelimCode1List => write!(f, stringify!(DelimCode1List)),
588 Self::DelimCode1ListGroup => write!(f, stringify!(DelimCode1ListGroup)),
589 Self::DelimCode2 => write!(f, stringify!(DelimCode2)),
590 Self::DelimCode2List => write!(f, stringify!(DelimCode2List)),
591 Self::DelimCode2ListGroup => write!(f, stringify!(DelimCode2ListGroup)),
592 Self::DelimCode3 => write!(f, stringify!(DelimCode3)),
593 Self::DelimCode3List => write!(f, stringify!(DelimCode3List)),
594 Self::DelimCode3ListGroup => write!(f, stringify!(DelimCode3ListGroup)),
595 Self::DelimCodeEnd1 => write!(f, stringify!(DelimCodeEnd1)),
596 Self::DelimCodeEnd2 => write!(f, stringify!(DelimCodeEnd2)),
597 Self::DelimCodeEnd3 => write!(f, stringify!(DelimCodeEnd3)),
598 Self::DelimCodeStart1 => write!(f, stringify!(DelimCodeStart1)),
599 Self::DelimCodeStart2 => write!(f, stringify!(DelimCodeStart2)),
600 Self::DelimCodeStart3 => write!(f, stringify!(DelimCodeStart3)),
601 Self::Dot => write!(f, stringify!(Dot)),
602 Self::End => write!(f, stringify!(End)),
603 Self::Eure => write!(f, stringify!(Eure)),
604 Self::EureList => write!(f, stringify!(EureList)),
605 Self::EureList0 => write!(f, stringify!(EureList0)),
606 Self::EureOpt => write!(f, stringify!(EureOpt)),
607 Self::Ext => write!(f, stringify!(Ext)),
608 Self::ExtensionNameSpace => write!(f, stringify!(ExtensionNameSpace)),
609 Self::False => write!(f, stringify!(False)),
610 Self::Float => write!(f, stringify!(Float)),
611 Self::GrammarNewline => write!(f, stringify!(GrammarNewline)),
612 Self::Hole => write!(f, stringify!(Hole)),
613 Self::Ident => write!(f, stringify!(Ident)),
614 Self::Inf => write!(f, stringify!(Inf)),
615 Self::InlineCode => write!(f, stringify!(InlineCode)),
616 Self::InlineCode1 => write!(f, stringify!(InlineCode1)),
617 Self::Integer => write!(f, stringify!(Integer)),
618 Self::Key => write!(f, stringify!(Key)),
619 Self::KeyBase => write!(f, stringify!(KeyBase)),
620 Self::KeyIdent => write!(f, stringify!(KeyIdent)),
621 Self::KeyOpt => write!(f, stringify!(KeyOpt)),
622 Self::KeyTuple => write!(f, stringify!(KeyTuple)),
623 Self::KeyTupleElements => write!(f, stringify!(KeyTupleElements)),
624 Self::KeyTupleElementsOpt => write!(f, stringify!(KeyTupleElementsOpt)),
625 Self::KeyTupleElementsTail => write!(f, stringify!(KeyTupleElementsTail)),
626 Self::KeyTupleElementsTailOpt => write!(f, stringify!(KeyTupleElementsTailOpt)),
627 Self::KeyTupleOpt => write!(f, stringify!(KeyTupleOpt)),
628 Self::KeyValue => write!(f, stringify!(KeyValue)),
629 Self::Keys => write!(f, stringify!(Keys)),
630 Self::KeysList => write!(f, stringify!(KeysList)),
631 Self::LParen => write!(f, stringify!(LParen)),
632 Self::LitStr => write!(f, stringify!(LitStr)),
633 Self::LitStr1 => write!(f, stringify!(LitStr1)),
634 Self::LitStr1End => write!(f, stringify!(LitStr1End)),
635 Self::LitStr1List => write!(f, stringify!(LitStr1List)),
636 Self::LitStr1ListGroup => write!(f, stringify!(LitStr1ListGroup)),
637 Self::LitStr1Start => write!(f, stringify!(LitStr1Start)),
638 Self::LitStr2 => write!(f, stringify!(LitStr2)),
639 Self::LitStr2End => write!(f, stringify!(LitStr2End)),
640 Self::LitStr2List => write!(f, stringify!(LitStr2List)),
641 Self::LitStr2ListGroup => write!(f, stringify!(LitStr2ListGroup)),
642 Self::LitStr2Start => write!(f, stringify!(LitStr2Start)),
643 Self::LitStr3 => write!(f, stringify!(LitStr3)),
644 Self::LitStr3End => write!(f, stringify!(LitStr3End)),
645 Self::LitStr3List => write!(f, stringify!(LitStr3List)),
646 Self::LitStr3ListGroup => write!(f, stringify!(LitStr3ListGroup)),
647 Self::LitStr3Start => write!(f, stringify!(LitStr3Start)),
648 Self::MapBind => write!(f, stringify!(MapBind)),
649 Self::NaN => write!(f, stringify!(NaN)),
650 Self::NoBacktick => write!(f, stringify!(NoBacktick)),
651 Self::NoSQuote => write!(f, stringify!(NoSQuote)),
652 Self::Null => write!(f, stringify!(Null)),
653 Self::Number => write!(f, stringify!(Number)),
654 Self::Object => write!(f, stringify!(Object)),
655 Self::ObjectList => write!(f, stringify!(ObjectList)),
656 Self::ObjectOpt => write!(f, stringify!(ObjectOpt)),
657 Self::ObjectOpt0 => write!(f, stringify!(ObjectOpt0)),
658 Self::ObjectOpt1 => write!(f, stringify!(ObjectOpt1)),
659 Self::RParen => write!(f, stringify!(RParen)),
660 Self::RootBinding => write!(f, stringify!(RootBinding)),
661 Self::SQuote => write!(f, stringify!(SQuote)),
662 Self::Section => write!(f, stringify!(Section)),
663 Self::SectionBinding => write!(f, stringify!(SectionBinding)),
664 Self::SectionBody => write!(f, stringify!(SectionBody)),
665 Self::SectionBodyList => write!(f, stringify!(SectionBodyList)),
666 Self::SectionBodyOpt => write!(f, stringify!(SectionBodyOpt)),
667 Self::Str => write!(f, stringify!(Str)),
668 Self::String => write!(f, stringify!(String)),
669 Self::Strings => write!(f, stringify!(Strings)),
670 Self::StringsList => write!(f, stringify!(StringsList)),
671 Self::Text => write!(f, stringify!(Text)),
672 Self::TextBinding => write!(f, stringify!(TextBinding)),
673 Self::TextBindingOpt => write!(f, stringify!(TextBindingOpt)),
674 Self::TextBindingOpt0 => write!(f, stringify!(TextBindingOpt0)),
675 Self::TextBindingOpt1 => write!(f, stringify!(TextBindingOpt1)),
676 Self::TextStart => write!(f, stringify!(TextStart)),
677 Self::True => write!(f, stringify!(True)),
678 Self::Tuple => write!(f, stringify!(Tuple)),
679 Self::TupleElements => write!(f, stringify!(TupleElements)),
680 Self::TupleElementsOpt => write!(f, stringify!(TupleElementsOpt)),
681 Self::TupleElementsTail => write!(f, stringify!(TupleElementsTail)),
682 Self::TupleElementsTailOpt => write!(f, stringify!(TupleElementsTailOpt)),
683 Self::TupleIndex => write!(f, stringify!(TupleIndex)),
684 Self::TupleOpt => write!(f, stringify!(TupleOpt)),
685 Self::Value => write!(f, stringify!(Value)),
686 Self::ValueBinding => write!(f, stringify!(ValueBinding)),
687 Self::Ws => write!(f, stringify!(Ws)),
688 Self::Root => write!(f, stringify!(Root)),
689 }
690 }
691}
692
693#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
694pub enum NodeKind<T, Nt> {
695 Terminal(T),
696 NonTerminal(Nt),
697}