-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtree-sitter-nim2.ebnf
812 lines (592 loc) · 29.8 KB
/
tree-sitter-nim2.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
//
// From tree-sitter-nim2/src/grammar.json
//
//
// EBNF to generate railroad diagram at
// (IPV6) https://www.bottlecaps.de/rr/ui
// (IPV4) https://rr.red-dove.com/ui
//
source_file ::=
_semi_statement_list
statement_list ::=
_block_statement_list
| _line_statement_list
| _layout_empty
_line_statement_list ::=
_simple_statement ( ';' _simple_statement )*
_block_statement_list ::=
_layout_start _semi_statement_list? _layout_end
_semi_statement_list ::=
( _statement ( ';' | _layout_terminator ) )+
_statement ::=
_simple_statement
| _complex_statement
_complex_statement ::=
while
| static_statement
| defer
| typeof
| _infix_typeof_expression
| _declaration
_simple_statement ::=
_expression_statement
| _simple_statement_no_expression
_simple_statement_no_expression ::=
import_statement
| import_from_statement
| export_statement
| include_statement
| discard_statement
| return_statement
| raise_statement
| yield_statement
| break_statement
| continue_statement
| assembly_statement
| bind_statement
| mixin_statement
| pragma_statement
_expression_statement ::=
_expression
| assignment
| _call_extended
| _infix_extended
| _prefix_extended
import_statement ::=
'i_'?[mM]'_'?[pP]'_'?[oO]'_'?[rR]'_'?[tT] _import_body
export_statement ::=
'e_'?[xX]'_'?[pP]'_'?[oO]'_'?[rR]'_'?[tT] _import_body
_import_body ::=
expression_list
| _import_except
_import_except ::=
_expression _inhibit_keyword_termination? except_clause
except_clause ::=
'e_'?[xX]'_'?[cC]'_'?[eE]'_'?[pP]'_'?[tT] expression_list
include_statement ::=
'i_'?[nN]'_'?[cC]'_'?[lL]'_'?[uU]'_'?[dD]'_'?[eE] expression_list
discard_statement ::=
'd_'?[iI]'_'?[sS]'_'?[cC]'_'?[aA]'_'?[rR]'_'?[dD] _expression_with_post_block?
return_statement ::=
'r_'?[eE]'_'?[tT]'_'?[uU]'_'?[rR]'_'?[nN] _expression_with_post_block?
raise_statement ::=
'r_'?[aA]'_'?[iI]'_'?[sS]'_'?[eE] _expression_with_post_block?
yield_statement ::=
'y_'?[iI]'_'?[eE]'_'?[lL]'_'?[dD] _expression_with_post_block?
break_statement ::=
'b_'?[rR]'_'?[eE]'_'?[aA]'_'?[kK] _expression_with_post_block?
continue_statement ::=
'c_'?[oO]'_'?[nN]'_'?[tT]'_'?[iI]'_'?[nN]'_'?[uU]'_'?[eE] _expression_with_post_block?
assembly_statement ::=
'a_'?[sS]'_'?[mM] pragma_list? _string_literal
bind_statement ::=
'b_'?[iI]'_'?[nN]'_'?[dD] expression_list
mixin_statement ::=
'm_'?[iI]'_'?[xX]'_'?[iI]'_'?[nN] expression_list
import_from_statement ::=
'f_'?[rR]'_'?[oO]'_'?[mM] _expression 'i_'?[mM]'_'?[pP]'_'?[oO]'_'?[rR]'_'?[tT] expression_list
while ::=
'w_'?[hH]'_'?[iI]'_'?[lL]'_'?[eE] _simple_expression ':' statement_list
static_statement ::=
's_'?[tT]'_'?[aA]'_'?[tT]'_'?[iI]'_'?[cC] ':' statement_list
pragma_statement ::=
pragma_list ( ':' statement_list )?
defer ::=
'd_'?[eE]'_'?[fF]'_'?[eE]'_'?[rR] ':' statement_list
_typeof_expression ::=
typeof
| _infix_typeof_expression
typeof ::=
't_'?[yY]'_'?[pP]'_'?[eE] '(' _simple_expression _paren_close
_infix_typeof_expression ::=
_typeof_expression _infix_operator_10r ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_10l ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_9 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_8 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_7 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_6 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_5 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_4 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_3 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_2 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_1 ( _typeof_expression | _simple_expression )
| _typeof_expression _infix_operator_0 ( _typeof_expression | _simple_expression )
_declaration ::=
proc_declaration
| func_declaration
| method_declaration
| iterator_declaration
| macro_declaration
| template_declaration
| converter_declaration
| using_section
| const_section
| let_section
| var_section
| type_section
proc_declaration ::=
'p_'?[rR]'_'?[oO]'_'?[cC] _routine_declaration
func_declaration ::=
'f_'?[uU]'_'?[nN]'_'?[cC] _routine_declaration
method_declaration ::=
'm_'?[eE]'_'?[tT]'_'?[hH]'_'?[oO]'_'?[dD] _routine_declaration
iterator_declaration ::=
'i_'?[tT]'_'?[eE]'_'?[rR]'_'?[aA]'_'?[tT]'_'?[oO]'_'?[rR] _routine_declaration
macro_declaration ::=
'm_'?[aA]'_'?[cC]'_'?[rR]'_'?[oO] _routine_declaration
template_declaration ::=
't_'?[eE]'_'?[mM]'_'?[pP]'_'?[lL]'_'?[aA]'_'?[tT]'_'?[eE] _routine_declaration
converter_declaration ::=
'c_'?[oO]'_'?[nN]'_'?[vV]'_'?[eE]'_'?[rR]'_'?[tT]'_'?[eE]'_'?[rR] _routine_declaration
_routine_declaration ::=
( _symbol | exported_symbol ) term_rewriting_pattern? generic_parameter_list? parameter_declaration_list? ( ':' type_expression )? pragma_list? ( '=' statement_list )?
generic_parameter_list ::=
'[' _parameter_declaration_list? _bracket_close
term_rewriting_pattern ::=
'{' _semi_statement_list _curly_close
using_section ::=
'u_'?[sS]'_'?[iI]'_'?[nN]'_'?[gG] _variable_declaration_section
const_section ::=
'c_'?[oO]'_'?[nN]'_'?[sS]'_'?[tT] _variable_declaration_section
let_section ::=
'l_'?[eE]'_'?[tT] _variable_declaration_section
var_section ::=
'v_'?[aA]'_'?[rR] _variable_declaration_section
_variable_declaration_section ::=
variable_declaration
| _layout_start ( variable_declaration _layout_terminator )* _layout_end
variable_declaration ::=
symbol_declaration_list ':' type_expression ( '=' _expression_with_post_block )?
| symbol_declaration_list ( '=' _expression_with_post_block )?
type_section ::=
't_'?[yY]'_'?[pP]'_'?[eE] ( type_declaration | _layout_start ( type_declaration _layout_terminator )* _layout_end )
type_declaration ::=
type_symbol_declaration ( '=' _type_definition )?
type_symbol_declaration ::=
( _symbol | exported_symbol ) generic_parameter_list? pragma_list?
_type_definition ::=
type_expression
| enum_declaration
| object_declaration
| concept_declaration
| _distinct_declaration
| _ref_declaration
| _pointer_declaration
| _tuple_declaration
| _call_extended
_distinct_declaration ::=
'd_'?[iI]'_'?[sS]'_'?[tT]'_'?[iI]'_'?[nN]'_'?[cC]'_'?[tT] _type_definition
_ref_declaration ::=
'r_'?[eE]'_'?[fF] _type_definition
_pointer_declaration ::=
'p_'?[tT]'_'?[rR] _type_definition
enum_declaration ::=
'e_'?[nN]'_'?[uU]'_'?[mM] ( ( enum_field_declaration ','? )+ | _layout_start ( ( enum_field_declaration ','? )+ _layout_terminator )* _layout_end )
enum_field_declaration ::=
symbol_declaration ( '=' _expression )?
_tuple_declaration ::=
't_'?[uU]'_'?[pP]'_'?[lL]'_'?[eE] _layout_start ( _identifier_declaration _layout_terminator )+ _layout_end
object_declaration ::=
'o_'?[bB]'_'?[jJ]'_'?[eE]'_'?[cC]'_'?[tT] pragma_list? ( 'o_'?[fF] type_expression )? _object_field_declaration_list?
_object_field_declaration_branch_list ::=
_object_field_declaration
| _object_field_declaration_list
| _layout_empty
_object_field_declaration_list ::=
_layout_start ( _object_field_declaration _layout_terminator )* _layout_end
_object_field_declaration ::=
_identifier_declaration
| conditional_declaration
| variant_declaration
| nil_literal
| 'd_'?[iI]'_'?[sS]'_'?[cC]'_'?[aA]'_'?[rR]'_'?[dD]
conditional_declaration ::=
'w_'?[hH]'_'?[eE]'_'?[nN] _expression ':' _object_field_declaration_branch_list ( _elif_declaration_branch | _else_declaration_branch | _inhibit_keyword_termination )*
_elif_declaration_branch ::=
'e_'?[lL]'_'?[iI]'_'?[fF] _expression ':' _object_field_declaration_branch_list
variant_declaration ::=
'c_'?[aA]'_'?[sS]'_'?[eE] _variant_declaration_body
_variant_declaration_body ::=
variant_discriminator_declaration ':'? _of_declaration_branch* _inhibit_keyword_termination? _else_declaration_branch?
variant_discriminator_declaration ::=
_identifier_declaration
_of_declaration_branch ::=
_case_of expression_list ':' _object_field_declaration_branch_list
_else_declaration_branch ::=
'e_'?[lL]'_'?[sS]'_'?[eE] ':' _object_field_declaration_branch_list
concept_declaration ::=
'c_'?[oO]'_'?[nN]'_'?[cC]'_'?[eE]'_'?[pP]'_'?[tT] _concept_parameter_list? ( 'o_'?[fF] refinement_list )? _block_statement_list?
refinement_list ::=
type_expression ( ',' type_expression )*
_concept_parameter_list ::=
_concept_parameter ( ',' _concept_parameter )*
_concept_parameter ::=
_symbol
| _concept_pointer_parameter
| _concept_ref_parameter
| _concept_static_parameter
| _concept_type_parameter
| _concept_var_parameter
_concept_pointer_parameter ::=
'p_'?[tT]'_'?[rR] _symbol
_concept_ref_parameter ::=
'r_'?[eE]'_'?[fF] _symbol
_concept_static_parameter ::=
's_'?[tT]'_'?[aA]'_'?[tT]'_'?[iI]'_'?[cC] _symbol
_concept_type_parameter ::=
't_'?[yY]'_'?[pP]'_'?[eE] _symbol
_concept_var_parameter ::=
'v_'?[aA]'_'?[rR] _symbol
_expression_with_post_block ::=
_expression_with_call_do
| _call_block
| _command_block
| _dot_generic_call_block
| _infix_extended
| _prefix_extended
_expression_with_call_do ::=
_expression
| _call_do
| _command_complex_expression
| _dot_generic_call_do
_expression ::=
_simple_expression
| proc_expression
| func_expression
| iterator_expression
| block
| if
| when
| case
| try
| for
_simple_expression ::=
_simple_expression_command_start
| _prefix_expression
_simple_expression_command_start ::=
_basic_expression
| _command_expression
| _infix_expression
| _prefix_expression_command_start
_basic_expression ::=
_literal
| _symbol
| array_construction
| curly_construction
| tuple_construction
| cast
| parenthesized
| dot_expression
| bracket_expression
| curly_expression
| generalized_string
| pragma_expression
| object_type
| tuple_type
| enum_type
| var_type
| out_type
| distinct_type
| ref_type
| pointer_type
| dot_generic_call
| _proc_type
| _iterator_type
| _call_expression
| _sigil_expression
for ::=
'f_'?[oO]'_'?[rR] _for_body ':' statement_list
_for_body ::=
symbol_declaration_list 'i_'?[nN] _expression
block ::=
'b_'?[lL]'_'?[oO]'_'?[cC]'_'?[kK] _symbol? ':' statement_list
if ::=
'i_'?[fF] _expression _if_body
when ::=
'w_'?[hH]'_'?[eE]'_'?[nN] _expression _if_body
_if_body ::=
':' statement_list _if_alternatives?
_if_branch ::=
elif_branch
| else_branch
_if_alternatives ::=
( _inhibit_keyword_termination | _if_branch )+
case ::=
'c_'?[aA]'_'?[sS]'_'?[eE] _expression ':'? of_branch* _if_alternatives?
try ::=
't_'?[rR]'_'?[yY] ':' statement_list ( _inhibit_keyword_termination | _try_branch )*
_try_branch ::=
except_branch
| finally_branch
of_branch ::=
_case_of expression_list ':' statement_list
elif_branch ::=
'e_'?[lL]'_'?[iI]'_'?[fF] _expression ':' statement_list
else_branch ::=
'e_'?[lL]'_'?[sS]'_'?[eE] ':' statement_list
except_branch ::=
'e_'?[xX]'_'?[cC]'_'?[eE]'_'?[pP]'_'?[tT] expression_list? ':' statement_list
finally_branch ::=
'f_'?[iI]'_'?[nN]'_'?[aA]'_'?[lL]'_'?[lL]'_'?[yY] ':' statement_list
do_block ::=
'd_'?[oO] parameter_declaration_list? ( '->' type_expression )? pragma_list? ':' statement_list
_call_extended ::=
_command_statement
| _call_block
| _dot_generic_call_block
_command_statement ::=
_basic_expression _command_statement_argument_list
_command_statement_argument_list ::=
_equal_expression_list ( ':' statement_list _post_expression_block_tail? )?
_command_block ::=
_basic_expression _command_block_argument_list
_command_block_argument_list ::=
_command_expression_argument_list ':' statement_list _post_expression_block_tail?
_dot_generic_call_block ::=
_dot_generic_head _call_block_argument_list
_call_block ::=
_basic_expression _call_block_argument_list
_call_block_argument_list ::=
_call_argument_list? _post_expression_block
_dot_generic_call_do ::=
_dot_generic_head _call_do_argument_list
_call_do ::=
_basic_expression _call_do_argument_list
_call_do_argument_list ::=
_call_argument_list? do_block _post_expression_block_tail?
_call_expression ::=
_basic_expression _call_argument_list
_call_argument_list ::=
'(' _colon_equal_expression_list? _paren_close
_command_complex_expression ::=
_basic_expression _command_complex_expression_argument_list
_command_complex_expression_argument_list ::=
_expression_with_call_do
_command_expression ::=
_basic_expression _command_expression_argument_list
_command_expression_argument_list ::=
_simple_expression_command_start
dot_generic_call ::=
_dot_generic_head _call_argument_list?
_dot_generic_head ::=
_basic_expression '.' _symbol _dot_generic_argument_list
_dot_generic_argument_list ::=
'[:' _expression ( ',' _expression )* _bracket_close
_post_expression_block ::=
( ':' statement_list | do_block ) _post_expression_block_tail?
_post_expression_block_tail ::=
( ( _if_branch | of_branch | _try_branch | do_block | _inhibit_keyword_termination ) )+
proc_expression ::=
_proc_type '=' statement_list
func_expression ::=
_func_type '=' statement_list
iterator_expression ::=
_iterator_type '=' statement_list
type_expression ::=
_simple_expression
object_type ::=
'o_'?[bB]'_'?[jJ]'_'?[eE]'_'?[cC]'_'?[tT]
enum_type ::=
'e_'?[nN]'_'?[uU]'_'?[mM]
tuple_type ::=
't_'?[uU]'_'?[pP]'_'?[lL]'_'?[eE] _tuple_field_declaration_list?
var_type ::=
'v_'?[aA]'_'?[rR] type_expression?
out_type ::=
'o_'?[uU]'_'?[tT] type_expression?
distinct_type ::=
'd_'?[iI]'_'?[sS]'_'?[tT]'_'?[iI]'_'?[nN]'_'?[cC]'_'?[tT] type_expression?
ref_type ::=
'r_'?[eE]'_'?[fF] type_expression?
pointer_type ::=
'p_'?[tT]'_'?[rR] type_expression?
_tuple_field_declaration_list ::=
( '[' | '[' ) _field_declaration_list? _bracket_close
_proc_type ::=
'p_'?[rR]'_'?[oO]'_'?[cC] parameter_declaration_list? ( ':' type_expression )? pragma_list?
_iterator_type ::=
'i_'?[tT]'_'?[eE]'_'?[rR]'_'?[aA]'_'?[tT]'_'?[oO]'_'?[rR] parameter_declaration_list? ( ':' type_expression )? pragma_list?
_func_type ::=
'f_'?[uU]'_'?[nN]'_'?[cC] parameter_declaration_list? ( ':' type_expression )? pragma_list?
_infix_extended ::=
_infix_expression _post_expression_block
_infix_expression ::=
_simple_expression _infix_operator_10r _simple_expression
| _simple_expression _infix_operator_10l _simple_expression
| _simple_expression _infix_operator_9 _simple_expression
| _simple_expression _infix_operator_8 _simple_expression
| _simple_expression _infix_operator_7 _simple_expression
| _simple_expression _infix_operator_6 _simple_expression
| _simple_expression _infix_operator_5 _simple_expression
| _simple_expression _infix_operator_4 _simple_expression
| _simple_expression _infix_operator_3 _simple_expression
| _simple_expression _infix_operator_2 _simple_expression
| _simple_expression _infix_operator_1 _simple_expression
| _simple_expression _infix_operator_0 _simple_expression
_infix_operator_0 ::=
( ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ( '=' | '-' | '~' ) '>' )
_infix_operator_1 ::=
( ( '+' | '-' | '*' | '/' | '@' | '$' | '&' | '%' | '|' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ '=' )
_infix_operator_10r ::=
( '^' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* )
_infix_operator_10l ::=
( '$' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* )
_infix_operator_9 ::=
( ( ( '%' | '\\' | '/' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( '*' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | 'd_'?[iI]'_'?[vV] | 'm_'?[oO]'_'?[dD] | 's_'?[hH]'_'?[lL] | 's_'?[hH]'_'?[rR] )
_infix_operator_8 ::=
( ( '+' | '-' | '~' | '|' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* )
_infix_operator_7 ::=
( '&' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* )
_infix_operator_6 ::=
( '.' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ )
_infix_operator_5 ::=
( ( '=' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ | ( '<' | '>' | '!' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | 'i_'?[nN] | 'n_'?[oO]'_'?[tT]'_'?[iI]'_'?[nN] | 'i_'?[sS] | 'i_'?[sS]'_'?[nN]'_'?[oO]'_'?[tT] | 'o_'?[fF] | 'a_'?[sS] | 'f_'?[rR]'_'?[oO]'_'?[mM] )
_infix_operator_4 ::=
( 'a_'?[nN]'_'?[dD] )
_infix_operator_3 ::=
( 'o_'?[rR] | 'x_'?[oO]'_'?[rR] )
_infix_operator_2 ::=
( ':' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ | ( '@' | '?' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* )
_prefix_extended ::=
_prefix_expression _post_expression_block
_prefix_expression ::=
_prefix_expression_command_start
| _prefix_expression_word
_prefix_expression_word ::=
( 'o_'?[rR] | 'x_'?[oO]'_'?[rR] | 'a_'?[nN]'_'?[dD] | 'i_'?[nN] | 'n_'?[oO]'_'?[tT]'_'?[iI]'_'?[nN] | 'i_'?[sS] | 'i_'?[sS]'_'?[nN]'_'?[oO]'_'?[tT] | 'o_'?[fF] | 'a_'?[sS] | 'f_'?[rR]'_'?[oO]'_'?[mM] | 'd_'?[iI]'_'?[vV] | 'm_'?[oO]'_'?[dD] | 's_'?[hH]'_'?[lL] | 's_'?[hH]'_'?[rR] ) _simple_expression
_prefix_expression_command_start ::=
_prefix_operator _simple_expression
| 'n_'?[oO]'_'?[tT] _simple_expression
| _sigil_operator _simple_expression
_sigil_expression ::=
_sigil_operator _basic_expression
_sigil_operator ::=
( '@' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* )
_prefix_operator ::=
( '^' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( '$' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( ( '%' | '\\' | '/' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( '*' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( ( '+' | '-' | '~' | '|' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( '&' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( '.' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ ) | ( '=' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ | ( '<' | '>' | '!' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( ':' ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ | ( '@' | '?' ) ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ) | ( ( '+' | '-' | '*' | '/' | '@' | '$' | '&' | '%' | '|' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )+ '=' ) | ( ( '=' | '+' | '-' | '*' | '/' | '<' | '>' | '@' | '$' | '~' | '&' | '%' | '|' | '!' | '?' | '^' | '.' | ':' | '\\' | '∙' | '∘' | '×' | '★' | '⊗' | '⊘' | '⊙' | '⊛' | '⊠' | '⊡' | '∩' | '∧' | '⊓' | '±' | '⊕' | '⊖' | '⊞' | '⊟' | '∪' | '∨' | '⊔' )* ( '=' | '-' | '~' ) '>' )
cast ::=
'c_'?[aA]'_'?[sS]'_'?[tT] ( '[' type_expression _bracket_close )? '(' ( _expression | colon_expression ) _paren_close
parenthesized ::=
'(' ( _expression_with_call_do | _simple_statement_no_expression | assignment | const_section | var_section | let_section | while ) ( ';' _statement )* ';'? _paren_close
| '(' ';' _statement ( ';' _statement )* ';'? _paren_close
dot_expression ::=
_basic_expression '.' _symbol
bracket_expression ::=
_basic_expression '[' _colon_equal_expression_list? _bracket_close
curly_expression ::=
_basic_expression '{' _colon_equal_expression_list? _curly_close
pragma_expression ::=
_basic_expression pragma_list
array_construction ::=
'[' _colon_equal_expression_list? _bracket_close
curly_construction ::=
'{' _colon_equal_expression_list _curly_close
| '{' ':'? _curly_close
tuple_construction ::=
'(' _colon_equal_expression_list? _paren_close
generalized_string ::=
( identifier | dot_expression ) _generalized_string_literal
_generalized_string_literal ::=
'"""' _long_string_body? '"""'
| '"' _raw_string_body? '"'
pragma_list ::=
'{.' _colon_equal_expression_list? ( _dot_curly_close | _curly_close )
expression_list ::=
( _expression ) ( ',' ( _expression ) )*
_equal_expression_list ::=
( _expression_with_call_do | equal_expression ) ( ',' ( _expression_with_call_do | equal_expression ) )*
_colon_equal_expression_list ::=
( _expression_with_call_do | colon_expression | equal_expression ) ( ',' ( _expression_with_call_do | colon_expression | equal_expression ) )* ','?
colon_expression ::=
_left_hand_side ':' _expression
equal_expression ::=
_left_hand_side '=' _expression
assignment ::=
_left_hand_side '=' _expression_with_post_block
_left_hand_side ::=
_simple_expression
parameter_declaration_list ::=
( '(' | '(' ) _parameter_declaration_list? _paren_close
_parameter_declaration_list ::=
_identifier_declaration ( ( ',' | ';' ) _identifier_declaration )* ( ',' | ';' )?
_field_declaration_list ::=
_identifier_declaration ( ( ',' | ';' ) _identifier_declaration )* ( ',' | ';' )?
_identifier_declaration ::=
symbol_declaration_list ( ':' type_expression )? ( '=' _expression_with_post_block )?
symbol_declaration_list ::=
( symbol_declaration | tuple_deconstruct_declaration ) ( ',' ( symbol_declaration | tuple_deconstruct_declaration ) )* ','?
tuple_deconstruct_declaration ::=
'(' ( symbol_declaration | tuple_deconstruct_declaration ) ( ',' ( symbol_declaration | tuple_deconstruct_declaration ) )* ','? _paren_close
symbol_declaration ::=
( _symbol | exported_symbol ) pragma_list?
exported_symbol ::=
_symbol _symbol_export_marker
_symbol_export_marker ::=
'*'
_literal ::=
nil_literal
| integer_literal
| float_literal
| custom_numeric_literal
| char_literal
| _string_literal
nil_literal ::=
'n_'?[iI]'_'?[lL]
integer_literal ::=
( ( '-'? ( [0-9]('_'?[0-9])* | '0'[xX][0-9a-fA-F]('_'?[0-9a-fA-F])* | '0'[oO][0-7]('_'?[0-7])* | '0'[bB][01]('_'?[01])* ) ) "'"?[iIuU]("8"|"16"|"32"|"64")|[uU]? )
float_literal ::=
( ( '-'? ( [0-9]('_'?[0-9])* | '0'[xX][0-9a-fA-F]('_'?[0-9a-fA-F])* | '0'[oO][0-7]('_'?[0-7])* | '0'[bB][01]('_'?[01])* ) ) "'"?[fFdD]("32"|"64"|"128")? | ( '-'? ( [0-9]('_'?[0-9])* '.' [0-9]('_'?[0-9])* | [0-9]('_'?[0-9])* [eE][+-]? [0-9]('_'?[0-9])* | [0-9]('_'?[0-9])* '.' [0-9]('_'?[0-9])* [eE][+-]? [0-9]('_'?[0-9])* ) ) "'"?[fFdD]("32"|"64"|"128")?? )
custom_numeric_literal ::=
( ( ( '-'? ( [0-9]('_'?[0-9])* | '0'[xX][0-9a-fA-F]('_'?[0-9a-fA-F])* | '0'[oO][0-7]('_'?[0-7])* | '0'[bB][01]('_'?[01])* ) ) | ( '-'? ( [0-9]('_'?[0-9])* '.' [0-9]('_'?[0-9])* | [0-9]('_'?[0-9])* [eE][+-]? [0-9]('_'?[0-9])* | [0-9]('_'?[0-9])* '.' [0-9]('_'?[0-9])* [eE][+-]? [0-9]('_'?[0-9])* ) ) ) "'" [a-zA-Z\U00000080-\U0010FFFF&&[^∙∘×★⊗⊘⊙⊛⊠⊡∩∧⊓±⊕⊖⊞⊟∪∨⊔]]('_'?[a-zA-Z0-9\U00000080-\U0010FFFF&&[^∙∘×★⊗⊘⊙⊛⊠⊡∩∧⊓±⊕⊖⊞⊟∪∨⊔]])* )
char_literal ::=
"'" ( [^\#x0A#x0D'] | _char_escape_sequence ) "'"
_char_escape_sequence ::=
( '\\' [rRcCnNlLfFtTvV\"'aAbBeE]|[0-9]+|[xX][0-9a-fA-F]"{2}" )
_string_literal ::=
interpreted_string_literal
| raw_string_literal
| long_string_literal
interpreted_string_literal ::=
'"' _interpreted_string_body? '"'
_interpreted_string_body ::=
( [^#x0A#x0D"\]+ | escape_sequence )+
escape_sequence ::=
( '\\' ( [rRcCnNlLfFtTvV\"'aAbBeE]|[0-9]+|[xX][0-9a-fA-F]"{2}" | [pP] | [uU]([0-9a-fA-F]'{4}'|'\{'[0-9a-fA-F]+'\}') ) )
raw_string_literal ::=
( 'r"' | 'R"' ) _raw_string_body? '"'
_raw_string_body ::=
( [^#x0A#x0D"] | _raw_string_escape )+
_raw_string_escape ::=
'""'
long_string_literal ::=
( '"""' | 'r"""' | 'R"""' ) _long_string_body? '"""'
_long_string_body ::=
( [^"]+ | _long_string_quote )+
_symbol ::=
accent_quoted
| identifier
| blank_identifier
accent_quoted ::=
'`' _accent_quoted_identifier+ '`'
_accent_quoted_identifier ::=
[^\x00-\x1f#x0D#x0A#x09` ]+
blank_identifier ::=
'_'
identifier ::=
[a-zA-Z\U00000080-\U0010FFFF&&[^∙∘×★⊗⊘⊙⊛⊠⊡∩∧⊓±⊕⊖⊞⊟∪∨⊔]]('_'?[a-zA-Z0-9\U00000080-\U0010FFFF&&[^∙∘×★⊗⊘⊙⊛⊠⊡∩∧⊓±⊕⊖⊞⊟∪∨⊔]])*
_paren_close ::=
_inhibit_layout_end? ')'
_bracket_close ::=
_inhibit_layout_end? ']'
_curly_close ::=
_inhibit_layout_end? '}'
_dot_curly_close ::=
_inhibit_layout_end? '.}'
block_documentation_comment ::=
'##[' _block_documentation_comment_content ']##'
block_comment ::=
'#[' _block_comment_content ']#'
documentation_comment ::=
'##' comment_content
comment ::=
'#' comment_content