-
Notifications
You must be signed in to change notification settings - Fork 2
/
erdm.peg.go
3024 lines (2983 loc) · 64.5 KB
/
erdm.peg.go
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
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package main
import (
"fmt"
"math"
"sort"
"strconv"
)
const endSymbol rune = 1114112
/* The rule types inferred from the grammar are below. */
type pegRule uint8
const (
ruleUnknown pegRule = iota
ruleroot
ruleEOT
ruleexpression
ruletitle_info
ruletable_info
rulecomment
ruleempty_line
ruletable_name_info
rulecolumn_info
rulecolumn_attribute
rulerelation
rulecolumn_comment
ruleindex_info
ruletitle
rulecomment_string
rulewhitespace
rulenewline
rulespace
rulenotnull
ruleunique
ruleerd
rulereal_table_name
ruletable_name
rulereal_column_name
rulecolumn_name
rulerelation_point
rulepkey
rulecol_type
ruledefault
rulecardinality_right
rulecardinality_left
rulecardinality
rulePegText
ruleAction0
ruleAction1
ruleAction2
ruleAction3
ruleAction4
ruleAction5
ruleAction6
ruleAction7
ruleAction8
ruleAction9
ruleAction10
ruleAction11
ruleAction12
ruleAction13
ruleAction14
ruleAction15
ruleAction16
ruleAction17
ruleAction18
ruleAction19
ruleAction20
)
var rul3s = [...]string{
"Unknown",
"root",
"EOT",
"expression",
"title_info",
"table_info",
"comment",
"empty_line",
"table_name_info",
"column_info",
"column_attribute",
"relation",
"column_comment",
"index_info",
"title",
"comment_string",
"whitespace",
"newline",
"space",
"notnull",
"unique",
"erd",
"real_table_name",
"table_name",
"real_column_name",
"column_name",
"relation_point",
"pkey",
"col_type",
"default",
"cardinality_right",
"cardinality_left",
"cardinality",
"PegText",
"Action0",
"Action1",
"Action2",
"Action3",
"Action4",
"Action5",
"Action6",
"Action7",
"Action8",
"Action9",
"Action10",
"Action11",
"Action12",
"Action13",
"Action14",
"Action15",
"Action16",
"Action17",
"Action18",
"Action19",
"Action20",
}
type token32 struct {
pegRule
begin, end uint32
}
func (t *token32) String() string {
return fmt.Sprintf("\x1B[34m%v\x1B[m %v %v", rul3s[t.pegRule], t.begin, t.end)
}
type node32 struct {
token32
up, next *node32
}
func (node *node32) Print(buffer string) {
var print func(node *node32, depth int)
print = func(node *node32, depth int) {
for node != nil {
for c := 0; c < depth; c++ {
fmt.Printf(" ")
}
fmt.Printf("\x1B[34m%v\x1B[m %v\n", rul3s[node.pegRule], strconv.Quote(string(([]rune(buffer)[node.begin:node.end]))))
if node.up != nil {
print(node.up, depth+1)
}
node = node.next
}
}
print(node, 0)
}
type tokens32 struct {
tree []token32
}
func (t *tokens32) Trim(length uint32) {
t.tree = t.tree[:length]
}
func (t *tokens32) Print() {
for _, token := range t.tree {
fmt.Println(token.String())
}
}
func (t *tokens32) AST() *node32 {
type element struct {
node *node32
down *element
}
tokens := t.Tokens()
var stack *element
for _, token := range tokens {
if token.begin == token.end {
continue
}
node := &node32{token32: token}
for stack != nil && stack.node.begin >= token.begin && stack.node.end <= token.end {
stack.node.next = node.up
node.up = stack.node
stack = stack.down
}
stack = &element{node: node, down: stack}
}
if stack != nil {
return stack.node
}
return nil
}
func (t *tokens32) PrintSyntaxTree(buffer string) {
t.AST().Print(buffer)
}
func (t *tokens32) Add(rule pegRule, begin, end, index uint32) {
if tree := t.tree; int(index) >= len(tree) {
expanded := make([]token32, 2*len(tree))
copy(expanded, tree)
t.tree = expanded
}
t.tree[index] = token32{
pegRule: rule,
begin: begin,
end: end,
}
}
func (t *tokens32) Tokens() []token32 {
return t.tree
}
type Parser struct {
ErdM
Buffer string
buffer []rune
rules [55]func() bool
parse func(rule ...int) error
reset func()
Pretty bool
tokens32
}
func (p *Parser) Parse(rule ...int) error {
return p.parse(rule...)
}
func (p *Parser) Reset() {
p.reset()
}
type textPosition struct {
line, symbol int
}
type textPositionMap map[int]textPosition
func translatePositions(buffer []rune, positions []int) textPositionMap {
length, translations, j, line, symbol := len(positions), make(textPositionMap, len(positions)), 0, 1, 0
sort.Ints(positions)
search:
for i, c := range buffer {
if c == '\n' {
line, symbol = line+1, 0
} else {
symbol++
}
if i == positions[j] {
translations[positions[j]] = textPosition{line, symbol}
for j++; j < length; j++ {
if i != positions[j] {
continue search
}
}
break search
}
}
return translations
}
type parseError struct {
p *Parser
max token32
}
func (e *parseError) Error() string {
tokens, error := []token32{e.max}, "\n"
positions, p := make([]int, 2*len(tokens)), 0
for _, token := range tokens {
positions[p], p = int(token.begin), p+1
positions[p], p = int(token.end), p+1
}
translations := translatePositions(e.p.buffer, positions)
format := "parse error near %v (line %v symbol %v - line %v symbol %v):\n%v\n"
if e.p.Pretty {
format = "parse error near \x1B[34m%v\x1B[m (line %v symbol %v - line %v symbol %v):\n%v\n"
}
for _, token := range tokens {
begin, end := int(token.begin), int(token.end)
error += fmt.Sprintf(format,
rul3s[token.pegRule],
translations[begin].line, translations[begin].symbol,
translations[end].line, translations[end].symbol,
strconv.Quote(string(e.p.buffer[begin:end])))
}
return error
}
func (p *Parser) PrintSyntaxTree() {
p.tokens32.PrintSyntaxTree(p.Buffer)
}
func (p *Parser) Execute() {
buffer, _buffer, text, begin, end := p.Buffer, p.buffer, "", 0, 0
for _, token := range p.Tokens() {
switch token.pegRule {
case rulePegText:
begin, end = int(token.begin), int(token.end)
text = string(_buffer[begin:end])
case ruleAction0:
p.Err(begin, buffer)
case ruleAction1:
p.Err(begin, buffer)
case ruleAction2:
p.setTitle(text)
case ruleAction3:
p.addTableTitleReal(text)
case ruleAction4:
p.addTableTitle(text)
case ruleAction5:
p.addPrimaryKey(text)
case ruleAction6:
p.setColumnNameReal(text)
case ruleAction7:
p.setColumnName(text)
case ruleAction8:
p.addColumnType(text)
case ruleAction9:
p.setNotNull()
case ruleAction10:
p.setUnique()
case ruleAction11:
p.setColumnDefault(text)
case ruleAction12:
p.setWithoutErd()
case ruleAction13:
p.setRelationSource(text)
case ruleAction14:
p.setRelationDestination(text)
case ruleAction15:
p.setRelationTableNameReal(text)
case ruleAction16:
p.addComment(text)
case ruleAction17:
p.setIndexName(text)
case ruleAction18:
p.setIndexColumn(text)
case ruleAction19:
p.setIndexColumn(text)
case ruleAction20:
p.setUniqueIndex()
}
}
_, _, _, _, _ = buffer, _buffer, text, begin, end
}
func (p *Parser) Init() {
var (
max token32
position, tokenIndex uint32
buffer []rune
)
p.reset = func() {
max = token32{}
position, tokenIndex = 0, 0
p.buffer = []rune(p.Buffer)
if len(p.buffer) == 0 || p.buffer[len(p.buffer)-1] != endSymbol {
p.buffer = append(p.buffer, endSymbol)
}
buffer = p.buffer
}
p.reset()
_rules, tree := p.rules, tokens32{tree: make([]token32, math.MaxInt16)}
p.parse = func(rule ...int) error {
r := 1
if len(rule) > 0 {
r = rule[0]
}
matches := p.rules[r]()
p.tokens32 = tree
if matches {
p.Trim(tokenIndex)
return nil
}
return &parseError{p, max}
}
add := func(rule pegRule, begin uint32) {
tree.Add(rule, begin, position, tokenIndex)
tokenIndex++
if begin != position && position > max.end {
max = token32{rule, begin, position}
}
}
matchDot := func() bool {
if buffer[position] != endSymbol {
position++
return true
}
return false
}
/*matchChar := func(c byte) bool {
if buffer[position] == c {
position++
return true
}
return false
}*/
/*matchRange := func(lower byte, upper byte) bool {
if c := buffer[position]; c >= lower && c <= upper {
position++
return true
}
return false
}*/
_rules = [...]func() bool{
nil,
/* 0 root <- <((expression EOT) / (expression <.+> Action0 EOT) / (<.+> Action1 EOT))> */
func() bool {
position0, tokenIndex0 := position, tokenIndex
{
position1 := position
{
position2, tokenIndex2 := position, tokenIndex
if !_rules[ruleexpression]() {
goto l3
}
if !_rules[ruleEOT]() {
goto l3
}
goto l2
l3:
position, tokenIndex = position2, tokenIndex2
if !_rules[ruleexpression]() {
goto l4
}
{
position5 := position
if !matchDot() {
goto l4
}
l6:
{
position7, tokenIndex7 := position, tokenIndex
if !matchDot() {
goto l7
}
goto l6
l7:
position, tokenIndex = position7, tokenIndex7
}
add(rulePegText, position5)
}
if !_rules[ruleAction0]() {
goto l4
}
if !_rules[ruleEOT]() {
goto l4
}
goto l2
l4:
position, tokenIndex = position2, tokenIndex2
{
position8 := position
if !matchDot() {
goto l0
}
l9:
{
position10, tokenIndex10 := position, tokenIndex
if !matchDot() {
goto l10
}
goto l9
l10:
position, tokenIndex = position10, tokenIndex10
}
add(rulePegText, position8)
}
if !_rules[ruleAction1]() {
goto l0
}
if !_rules[ruleEOT]() {
goto l0
}
}
l2:
add(ruleroot, position1)
}
return true
l0:
position, tokenIndex = position0, tokenIndex0
return false
},
/* 1 EOT <- <!.> */
func() bool {
position11, tokenIndex11 := position, tokenIndex
{
position12 := position
{
position13, tokenIndex13 := position, tokenIndex
if !matchDot() {
goto l13
}
goto l11
l13:
position, tokenIndex = position13, tokenIndex13
}
add(ruleEOT, position12)
}
return true
l11:
position, tokenIndex = position11, tokenIndex11
return false
},
/* 2 expression <- <(title_info (table_info / comment / empty_line)*)> */
func() bool {
position14, tokenIndex14 := position, tokenIndex
{
position15 := position
if !_rules[ruletitle_info]() {
goto l14
}
l16:
{
position17, tokenIndex17 := position, tokenIndex
{
position18, tokenIndex18 := position, tokenIndex
if !_rules[ruletable_info]() {
goto l19
}
goto l18
l19:
position, tokenIndex = position18, tokenIndex18
if !_rules[rulecomment]() {
goto l20
}
goto l18
l20:
position, tokenIndex = position18, tokenIndex18
if !_rules[ruleempty_line]() {
goto l17
}
}
l18:
goto l16
l17:
position, tokenIndex = position17, tokenIndex17
}
add(ruleexpression, position15)
}
return true
l14:
position, tokenIndex = position14, tokenIndex14
return false
},
/* 3 title_info <- <('#' space* ('T' 'i' 't' 'l' 'e' ':') space* <title> Action2 newline)> */
func() bool {
position21, tokenIndex21 := position, tokenIndex
{
position22 := position
if buffer[position] != rune('#') {
goto l21
}
position++
l23:
{
position24, tokenIndex24 := position, tokenIndex
if !_rules[rulespace]() {
goto l24
}
goto l23
l24:
position, tokenIndex = position24, tokenIndex24
}
if buffer[position] != rune('T') {
goto l21
}
position++
if buffer[position] != rune('i') {
goto l21
}
position++
if buffer[position] != rune('t') {
goto l21
}
position++
if buffer[position] != rune('l') {
goto l21
}
position++
if buffer[position] != rune('e') {
goto l21
}
position++
if buffer[position] != rune(':') {
goto l21
}
position++
l25:
{
position26, tokenIndex26 := position, tokenIndex
if !_rules[rulespace]() {
goto l26
}
goto l25
l26:
position, tokenIndex = position26, tokenIndex26
}
{
position27 := position
if !_rules[ruletitle]() {
goto l21
}
add(rulePegText, position27)
}
if !_rules[ruleAction2]() {
goto l21
}
if !_rules[rulenewline]() {
goto l21
}
add(ruletitle_info, position22)
}
return true
l21:
position, tokenIndex = position21, tokenIndex21
return false
},
/* 4 table_info <- <(table_name_info column_info* index_info*)> */
func() bool {
position28, tokenIndex28 := position, tokenIndex
{
position29 := position
if !_rules[ruletable_name_info]() {
goto l28
}
l30:
{
position31, tokenIndex31 := position, tokenIndex
if !_rules[rulecolumn_info]() {
goto l31
}
goto l30
l31:
position, tokenIndex = position31, tokenIndex31
}
l32:
{
position33, tokenIndex33 := position, tokenIndex
if !_rules[ruleindex_info]() {
goto l33
}
goto l32
l33:
position, tokenIndex = position33, tokenIndex33
}
add(ruletable_info, position29)
}
return true
l28:
position, tokenIndex = position28, tokenIndex28
return false
},
/* 5 comment <- <(space* ('/' '/') comment_string newline)> */
func() bool {
position34, tokenIndex34 := position, tokenIndex
{
position35 := position
l36:
{
position37, tokenIndex37 := position, tokenIndex
if !_rules[rulespace]() {
goto l37
}
goto l36
l37:
position, tokenIndex = position37, tokenIndex37
}
if buffer[position] != rune('/') {
goto l34
}
position++
if buffer[position] != rune('/') {
goto l34
}
position++
if !_rules[rulecomment_string]() {
goto l34
}
if !_rules[rulenewline]() {
goto l34
}
add(rulecomment, position35)
}
return true
l34:
position, tokenIndex = position34, tokenIndex34
return false
},
/* 6 empty_line <- <whitespace> */
func() bool {
position38, tokenIndex38 := position, tokenIndex
{
position39 := position
if !_rules[rulewhitespace]() {
goto l38
}
add(ruleempty_line, position39)
}
return true
l38:
position, tokenIndex = position38, tokenIndex38
return false
},
/* 7 table_name_info <- <(<real_table_name> Action3 space* ('/' space* <table_name> Action4)? space* newline*)> */
func() bool {
position40, tokenIndex40 := position, tokenIndex
{
position41 := position
{
position42 := position
if !_rules[rulereal_table_name]() {
goto l40
}
add(rulePegText, position42)
}
if !_rules[ruleAction3]() {
goto l40
}
l43:
{
position44, tokenIndex44 := position, tokenIndex
if !_rules[rulespace]() {
goto l44
}
goto l43
l44:
position, tokenIndex = position44, tokenIndex44
}
{
position45, tokenIndex45 := position, tokenIndex
if buffer[position] != rune('/') {
goto l45
}
position++
l47:
{
position48, tokenIndex48 := position, tokenIndex
if !_rules[rulespace]() {
goto l48
}
goto l47
l48:
position, tokenIndex = position48, tokenIndex48
}
{
position49 := position
if !_rules[ruletable_name]() {
goto l45
}
add(rulePegText, position49)
}
if !_rules[ruleAction4]() {
goto l45
}
goto l46
l45:
position, tokenIndex = position45, tokenIndex45
}
l46:
l50:
{
position51, tokenIndex51 := position, tokenIndex
if !_rules[rulespace]() {
goto l51
}
goto l50
l51:
position, tokenIndex = position51, tokenIndex51
}
l52:
{
position53, tokenIndex53 := position, tokenIndex
if !_rules[rulenewline]() {
goto l53
}
goto l52
l53:
position, tokenIndex = position53, tokenIndex53
}
add(ruletable_name_info, position41)
}
return true
l40:
position, tokenIndex = position40, tokenIndex40
return false
},
/* 8 column_info <- <(column_attribute (space* relation (space* relation)*)? (newline? column_comment)* newline?)> */
func() bool {
position54, tokenIndex54 := position, tokenIndex
{
position55 := position
if !_rules[rulecolumn_attribute]() {
goto l54
}
{
position56, tokenIndex56 := position, tokenIndex
l58:
{
position59, tokenIndex59 := position, tokenIndex
if !_rules[rulespace]() {
goto l59
}
goto l58
l59:
position, tokenIndex = position59, tokenIndex59
}
if !_rules[rulerelation]() {
goto l56
}
l60:
{
position61, tokenIndex61 := position, tokenIndex
l62:
{
position63, tokenIndex63 := position, tokenIndex
if !_rules[rulespace]() {
goto l63
}
goto l62
l63:
position, tokenIndex = position63, tokenIndex63
}
if !_rules[rulerelation]() {
goto l61
}
goto l60
l61:
position, tokenIndex = position61, tokenIndex61
}
goto l57
l56:
position, tokenIndex = position56, tokenIndex56
}
l57:
l64:
{
position65, tokenIndex65 := position, tokenIndex
{
position66, tokenIndex66 := position, tokenIndex
if !_rules[rulenewline]() {
goto l66
}
goto l67
l66:
position, tokenIndex = position66, tokenIndex66
}
l67:
if !_rules[rulecolumn_comment]() {
goto l65
}
goto l64
l65:
position, tokenIndex = position65, tokenIndex65
}
{
position68, tokenIndex68 := position, tokenIndex
if !_rules[rulenewline]() {
goto l68
}
goto l69
l68:
position, tokenIndex = position68, tokenIndex68
}
l69:
add(rulecolumn_info, position55)
}
return true
l54:
position, tokenIndex = position54, tokenIndex54
return false
},
/* 9 column_attribute <- <(space+ (<pkey> Action5)? <real_column_name> Action6 ('/' <column_name> Action7)? space+ '[' <col_type> Action8 ']' (('[' notnull Action9 ']') / ('[' unique Action10 ']') / ('[' '=' <default> Action11 ']') / ('[' <erd> Action12 ']'))* newline?)> */
func() bool {
position70, tokenIndex70 := position, tokenIndex
{
position71 := position
if !_rules[rulespace]() {
goto l70
}
l72:
{
position73, tokenIndex73 := position, tokenIndex
if !_rules[rulespace]() {
goto l73
}
goto l72
l73:
position, tokenIndex = position73, tokenIndex73
}
{
position74, tokenIndex74 := position, tokenIndex
{
position76 := position
if !_rules[rulepkey]() {
goto l74
}
add(rulePegText, position76)
}
if !_rules[ruleAction5]() {
goto l74
}
goto l75
l74:
position, tokenIndex = position74, tokenIndex74
}
l75:
{
position77 := position
if !_rules[rulereal_column_name]() {
goto l70
}
add(rulePegText, position77)
}
if !_rules[ruleAction6]() {
goto l70
}
{
position78, tokenIndex78 := position, tokenIndex
if buffer[position] != rune('/') {
goto l78
}
position++
{
position80 := position
if !_rules[rulecolumn_name]() {
goto l78
}
add(rulePegText, position80)
}
if !_rules[ruleAction7]() {
goto l78
}
goto l79
l78:
position, tokenIndex = position78, tokenIndex78
}
l79:
if !_rules[rulespace]() {
goto l70
}
l81:
{
position82, tokenIndex82 := position, tokenIndex
if !_rules[rulespace]() {
goto l82
}
goto l81
l82:
position, tokenIndex = position82, tokenIndex82
}
if buffer[position] != rune('[') {
goto l70
}
position++
{
position83 := position
if !_rules[rulecol_type]() {
goto l70
}
add(rulePegText, position83)
}
if !_rules[ruleAction8]() {
goto l70
}
if buffer[position] != rune(']') {
goto l70
}
position++
l84:
{
position85, tokenIndex85 := position, tokenIndex
{
position86, tokenIndex86 := position, tokenIndex
if buffer[position] != rune('[') {
goto l87
}