sqllang 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -562,8 +562,8 @@ var lexer = (() => {
562
562
  const NAMES = tokens.map((t) => t.name);
563
563
  const SKIP = tokens.map((t) => t.skip ? 1 : 0);
564
564
  const DISPATCH = "\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0101\u0101\u0101\u0101\u0101\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0101\u0102\u0103\u0100\u0104\u0105\u0100\u0106\u0107\u0108\u0109\u010A\u010B\u010C\u010D\u010E\u010F\u010F\u010F\u010F\u010F\u010F\u010F\u010F\u010F\u010F\u0110\u0111\u0112\u0113\u0114\u0115\u0100\u0116\u0117\u0118\u0119\u011A\u011B\u011C\u011D\u011E\u011F\u0120\u0121\u0120\u0122\u0123\u0124\u0120\u0125\u0126\u0127\u0128\u0129\u012A\u0120\u0120\u0120\u012B\u0100\u012C\u0100\u0120\u012D\u0116\u0117\u0118\u0119\u011A\u011B\u011C\u011D\u011E\u011F\u0120\u0121\u0120\u0122\u0123\u0124\u0120\u0125\u0126\u0127\u0128\u0129\u012A\u0120\u0120\u0120\u0100\u012E\u0100\u0100\u0100\u0101";
565
- const RX = [[0, "y"], [63, "y"], [58, "y"], [2, "y"], [67, "y"], [57, "iy"], [61, "y"]].map(([i, flags]) => new RegExp(tokens[i].pattern, flags));
566
- const KW = [[[97, 115], [65, 83]], [[97, 108, 108], [65, 76, 76]], [[97, 110, 100], [65, 78, 68]], [[97, 115, 99], [65, 83, 67]], [[98, 101, 116, 119, 101, 101, 110], [66, 69, 84, 87, 69, 69, 78]], [[98, 121], [66, 89]], [[99, 114, 111, 115, 115], [67, 82, 79, 83, 83]], [[99, 97, 115, 101], [67, 65, 83, 69]], [[99, 97, 115, 116], [67, 65, 83, 84]], [[100, 105, 115, 116, 105, 110, 99, 116], [68, 73, 83, 84, 73, 78, 67, 84]], [[100, 101, 115, 99], [68, 69, 83, 67]], [[101, 108, 115, 101], [69, 76, 83, 69]], [[101, 110, 100], [69, 78, 68]], [[101, 120, 99, 101, 112, 116], [69, 88, 67, 69, 80, 84]], [[101, 120, 105, 115, 116, 115], [69, 88, 73, 83, 84, 83]], [[101, 120, 116, 114, 97, 99, 116], [69, 88, 84, 82, 65, 67, 84]], [[102, 114, 111, 109], [70, 82, 79, 77]], [[102, 117, 108, 108], [70, 85, 76, 76]], [[102, 97, 108, 115, 101], [70, 65, 76, 83, 69]], [[102, 105, 108, 116, 101, 114], [70, 73, 76, 84, 69, 82]], [[102, 111, 114], [70, 79, 82]], [[103, 114, 111, 117, 112], [71, 82, 79, 85, 80]], [[104, 97, 118, 105, 110, 103], [72, 65, 86, 73, 78, 71]], [[105, 110], [73, 78]], [[105, 115], [73, 83]], [[105, 108, 105, 107, 101], [73, 76, 73, 75, 69]], [[105, 110, 110, 101, 114], [73, 78, 78, 69, 82]], [[105, 110, 115, 101, 114, 116], [73, 78, 83, 69, 82, 84]], [[105, 110, 116, 111], [73, 78, 84, 79]], [[105, 110, 116, 101, 114, 115, 101, 99, 116], [73, 78, 84, 69, 82, 83, 69, 67, 84]], [[106, 111, 105, 110], [74, 79, 73, 78]], [[108, 105, 107, 101], [76, 73, 75, 69]], [[108, 101, 102, 116], [76, 69, 70, 84]], [[108, 105, 109, 105, 116], [76, 73, 77, 73, 84]], [[110, 111, 116], [78, 79, 84]], [[110, 117, 108, 108], [78, 85, 76, 76]], [[110, 117, 108, 108, 115], [78, 85, 76, 76, 83]], [[111, 114], [79, 82]], [[111, 117, 116, 101, 114], [79, 85, 84, 69, 82]], [[111, 110], [79, 78]], [[111, 114, 100, 101, 114], [79, 82, 68, 69, 82]], [[111, 102, 102, 115, 101, 116], [79, 70, 70, 83, 69, 84]], [[111, 118, 101, 114], [79, 86, 69, 82]], [[112, 97, 114, 116, 105, 116, 105, 111, 110], [80, 65, 82, 84, 73, 84, 73, 79, 78]], [[114, 105, 103, 104, 116], [82, 73, 71, 72, 84]], [[115, 101, 108, 101, 99, 116], [83, 69, 76, 69, 67, 84]], [[116, 114, 117, 101], [84, 82, 85, 69]], [[116, 104, 101, 110], [84, 72, 69, 78]], [[117, 115, 105, 110, 103], [85, 83, 73, 78, 71]], [[117, 110, 105, 111, 110], [85, 78, 73, 79, 78]], [[118, 97, 108, 117, 101, 115], [86, 65, 76, 85, 69, 83]], [[119, 104, 101, 114, 101], [87, 72, 69, 82, 69]], [[119, 104, 101, 110], [87, 72, 69, 78]], [[119, 105, 116, 104], [87, 73, 84, 72]]];
565
+ const RX = [[0, "y"], [58, "y"], [2, "y"], [57, "iy"]].map(([i, flags]) => new RegExp(tokens[i].pattern, flags));
566
+ const KW = [[[112, 97, 114, 116, 105, 116, 105, 111, 110], [80, 65, 82, 84, 73, 84, 73, 79, 78]]];
567
567
  const look0 = (c) => c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122;
568
568
  function scanKeyword(text, offset, length, lower, upper, look) {
569
569
  const n = lower.length;
@@ -613,885 +613,1428 @@ var lexer = (() => {
613
613
  j += 2;
614
614
  }
615
615
  }
616
- function tokenize2(text) {
617
- if (typeof text !== "string") throw new TypeError("tokenize: expected a string");
618
- const tokens_ = [];
619
- let offset = 0;
620
- let line = 1;
621
- let lineStart = 0;
622
- const length = text.length;
623
- let m = null;
624
- while (offset < length) {
625
- const code2 = text.charCodeAt(offset);
626
- let id = -1;
627
- let end = -1;
628
- let matched = null;
629
- found: {
630
- switch (DISPATCH.charCodeAt(code2 < 128 ? code2 : 128) - 256) {
631
- case 1: {
632
- {
633
- const e = scan0(text, offset, length);
634
- if (e === -2) {
635
- RX[0].lastIndex = offset;
636
- if (RX[0].test(text) && RX[0].lastIndex > offset) {
637
- id = 0;
638
- end = RX[0].lastIndex;
639
- matched = null;
640
- break found;
641
- }
642
- } else if (e !== -1) {
643
- id = 0;
644
- end = e;
645
- matched = null;
646
- break found;
647
- }
648
- }
649
- break;
616
+ let dfaId = 0;
617
+ const isNaWs = (c) => c === 160 || c === 5760 || c >= 8192 && c <= 8202 || c === 8232 || c === 8233 || c === 8239 || c === 8287 || c === 12288 || c === 65279;
618
+ const symOf = (c) => c < 128 ? c : isNaWs(c) ? 129 : 128;
619
+ const is0 = (c) => c === 36;
620
+ const is1 = (c) => c >= 48 && c <= 57;
621
+ const is2 = (c) => c === 58;
622
+ const is3 = (c) => c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122;
623
+ const is4 = (c) => c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122;
624
+ const is5 = (c) => c === 96;
625
+ const is6 = (c) => c >= 0 && c <= 95 || c >= 97 && c <= 127 || c >= 128;
626
+ const is7 = (c) => c === 80 || c === 112;
627
+ const is8 = (c) => c === 73 || c === 105;
628
+ const is9 = (c) => c === 86 || c === 118;
629
+ const is10 = (c) => c === 79 || c === 111;
630
+ const is11 = (c) => c === 84 || c === 116;
631
+ const skip1 = (text, i, length) => {
632
+ while (i + 1 < length && is1(text.charCodeAt(i + 1))) i++;
633
+ return i;
634
+ };
635
+ const skip4 = (text, i, length) => {
636
+ while (i + 1 < length && is4(text.charCodeAt(i + 1))) i++;
637
+ return i;
638
+ };
639
+ const skip6 = (text, i, length) => {
640
+ while (i + 1 < length && is6(text.charCodeAt(i + 1))) i++;
641
+ return i;
642
+ };
643
+ const G0 = [63];
644
+ function dfa0(text, offset, length) {
645
+ let state = 1;
646
+ let winner = -1;
647
+ let end = -1;
648
+ let i = offset;
649
+ loop: for (; i < length; ) {
650
+ const c = text.charCodeAt(i);
651
+ switch (state) {
652
+ case 1:
653
+ if (is0(c)) {
654
+ state = 2;
655
+ } else break loop;
656
+ break;
657
+ case 2:
658
+ if (is1(c)) {
659
+ state = 3;
660
+ } else break loop;
661
+ break;
662
+ case 3:
663
+ if (is1(c)) {
664
+ i = skip1(text, i, length);
665
+ } else break loop;
666
+ break;
667
+ }
668
+ i++;
669
+ switch (state) {
670
+ case 3:
671
+ if (winner === -1 || 0 < winner) {
672
+ winner = 0;
673
+ end = i;
674
+ } else if (winner === 0 && i > end) end = i;
675
+ break;
676
+ }
677
+ }
678
+ if (winner === -1) return -1;
679
+ dfaId = G0[winner];
680
+ return end;
681
+ }
682
+ const G1 = [67];
683
+ function dfa1(text, offset, length) {
684
+ let state = 1;
685
+ let winner = -1;
686
+ let end = -1;
687
+ let i = offset;
688
+ loop: for (; i < length; ) {
689
+ const c = text.charCodeAt(i);
690
+ switch (state) {
691
+ case 1:
692
+ if (is2(c)) {
693
+ state = 2;
694
+ } else break loop;
695
+ break;
696
+ case 2:
697
+ if (is3(c)) {
698
+ state = 3;
699
+ } else break loop;
700
+ break;
701
+ case 3:
702
+ if (is4(c)) {
703
+ i = skip4(text, i, length);
704
+ } else break loop;
705
+ break;
706
+ }
707
+ i++;
708
+ switch (state) {
709
+ case 3:
710
+ if (winner === -1 || 0 < winner) {
711
+ winner = 0;
712
+ end = i;
713
+ } else if (winner === 0 && i > end) end = i;
714
+ break;
715
+ }
716
+ }
717
+ if (winner === -1) return -1;
718
+ dfaId = G1[winner];
719
+ return end;
720
+ }
721
+ const G2 = [61];
722
+ function dfa2(text, offset, length) {
723
+ let state = 1;
724
+ let winner = -1;
725
+ let end = -1;
726
+ let i = offset;
727
+ loop: for (; i < length; ) {
728
+ const c = text.charCodeAt(i);
729
+ switch (state) {
730
+ case 1:
731
+ if (is5(c)) {
732
+ state = 2;
733
+ } else break loop;
734
+ break;
735
+ case 2:
736
+ if (is6(c)) {
737
+ i = skip6(text, i, length);
738
+ } else if (is5(c)) {
739
+ state = 3;
740
+ } else break loop;
741
+ break;
742
+ case 3:
743
+ break loop;
744
+ }
745
+ i++;
746
+ switch (state) {
747
+ case 3:
748
+ if (winner === -1 || 0 < winner) {
749
+ winner = 0;
750
+ end = i;
751
+ } else if (winner === 0 && i > end) end = i;
752
+ break;
753
+ }
754
+ }
755
+ if (winner === -1) return -1;
756
+ dfaId = G2[winner];
757
+ return end;
758
+ }
759
+ let calls3 = 0;
760
+ let passes3 = 0;
761
+ let off3 = false;
762
+ function dfa3(text, offset, length) {
763
+ let state = 1;
764
+ let mask = 0;
765
+ let i = offset;
766
+ loop: for (; i < length; ) {
767
+ const c = text.charCodeAt(i);
768
+ switch (state) {
769
+ case 1:
770
+ if (is7(c)) {
771
+ state = 2;
772
+ } else break loop;
773
+ break;
774
+ case 2:
775
+ if (is8(c)) {
776
+ state = 3;
777
+ } else break loop;
778
+ break;
779
+ case 3:
780
+ if (is9(c)) {
781
+ state = 4;
782
+ } else break loop;
783
+ break;
784
+ case 4:
785
+ if (is10(c)) {
786
+ state = 5;
787
+ } else break loop;
788
+ break;
789
+ case 5:
790
+ if (is11(c)) {
791
+ state = 6;
792
+ } else break loop;
793
+ break;
794
+ case 6:
795
+ break loop;
796
+ }
797
+ i++;
798
+ switch (state) {
799
+ case 6:
800
+ mask |= 1;
801
+ break;
802
+ }
803
+ }
804
+ return mask;
805
+ }
806
+ let wordId = 0;
807
+ function word0(text, offset, length) {
808
+ let c = text.charCodeAt(offset);
809
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
810
+ let h = 0;
811
+ let j = offset;
812
+ while (j < length) {
813
+ c = text.charCodeAt(j);
814
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
815
+ if (c >= 65 && c <= 90) c += 32;
816
+ h = Math.imul(h, 31) + c | 0;
817
+ j++;
818
+ }
819
+ const len = j - offset;
820
+ if (len > 0) {
821
+ switch (h) {
822
+ case 3122:
823
+ if (len === 2 && ((c = text.charCodeAt(offset + 0)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 1)) === 115 || c === 83)) {
824
+ wordId = 6;
825
+ return j;
650
826
  }
651
- case 2: {
652
- if (text.startsWith("!=", offset)) {
653
- id = 72;
654
- end = offset + 2;
655
- matched = "!=";
656
- break found;
657
- }
658
- break;
827
+ break;
828
+ case 96673:
829
+ if (len === 3 && ((c = text.charCodeAt(offset + 0)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 1)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76)) {
830
+ wordId = 8;
831
+ return j;
659
832
  }
660
- case 3: {
661
- {
662
- const e = scan60(text, offset);
663
- if (e !== -1) {
664
- id = 60;
665
- end = e;
666
- matched = null;
667
- break found;
668
- }
669
- }
670
- break;
833
+ break;
834
+ case 96727:
835
+ if (len === 3 && ((c = text.charCodeAt(offset + 0)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 100 || c === 68)) {
836
+ wordId = 9;
837
+ return j;
671
838
  }
672
- case 4: {
673
- RX[1].lastIndex = offset;
674
- m = RX[1].exec(text);
675
- if (m !== null && m[0].length > 0) {
676
- id = 63;
677
- matched = m[0];
678
- end = offset + matched.length;
679
- break found;
680
- }
681
- break;
839
+ break;
840
+ case 96881:
841
+ if (len === 3 && ((c = text.charCodeAt(offset + 0)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 1)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 2)) === 99 || c === 67)) {
842
+ wordId = 30;
843
+ return j;
682
844
  }
683
- case 5: {
684
- if (code2 === 37) {
685
- id = 81;
686
- end = offset + 1;
687
- matched = "%";
688
- break found;
689
- }
690
- break;
845
+ break;
846
+ }
847
+ }
848
+ if (j === offset) j++;
849
+ while (j < length) {
850
+ c = text.charCodeAt(j);
851
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
852
+ j++;
853
+ }
854
+ wordId = 62;
855
+ return j;
856
+ }
857
+ function word1(text, offset, length) {
858
+ let c = text.charCodeAt(offset);
859
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
860
+ let h = 0;
861
+ let j = offset;
862
+ while (j < length) {
863
+ c = text.charCodeAt(j);
864
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
865
+ if (c >= 65 && c <= 90) c += 32;
866
+ h = Math.imul(h, 31) + c | 0;
867
+ j++;
868
+ }
869
+ const len = j - offset;
870
+ if (len > 0) {
871
+ switch (h) {
872
+ case -216634360:
873
+ if (len === 7 && ((c = text.charCodeAt(offset + 0)) === 98 || c === 66) && ((c = text.charCodeAt(offset + 1)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 3)) === 119 || c === 87) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 5)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 6)) === 110 || c === 78)) {
874
+ wordId = 17;
875
+ return j;
691
876
  }
692
- case 6: {
693
- {
694
- const e = scan59(text, offset);
695
- if (e !== -1) {
696
- id = 59;
697
- end = e;
698
- matched = null;
699
- break found;
700
- }
701
- }
702
- break;
877
+ break;
878
+ case 3159:
879
+ if (len === 2 && ((c = text.charCodeAt(offset + 0)) === 98 || c === 66) && ((c = text.charCodeAt(offset + 1)) === 121 || c === 89)) {
880
+ wordId = 28;
881
+ return j;
703
882
  }
704
- case 7: {
705
- if (code2 === 40) {
706
- id = 82;
707
- end = offset + 1;
708
- matched = "(";
709
- break found;
710
- }
711
- break;
883
+ break;
884
+ }
885
+ }
886
+ if (j === offset) j++;
887
+ while (j < length) {
888
+ c = text.charCodeAt(j);
889
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
890
+ j++;
891
+ }
892
+ wordId = 62;
893
+ return j;
894
+ }
895
+ function word2(text, offset, length) {
896
+ let c = text.charCodeAt(offset);
897
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
898
+ let h = 0;
899
+ let j = offset;
900
+ while (j < length) {
901
+ c = text.charCodeAt(j);
902
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
903
+ if (c >= 65 && c <= 90) c += 32;
904
+ h = Math.imul(h, 31) + c | 0;
905
+ j++;
906
+ }
907
+ const len = j - offset;
908
+ if (len > 0) {
909
+ switch (h) {
910
+ case 94935104:
911
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 1)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 2)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 3)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 4)) === 115 || c === 83)) {
912
+ wordId = 23;
913
+ return j;
712
914
  }
713
- case 8: {
714
- if (code2 === 41) {
715
- id = 83;
716
- end = offset + 1;
717
- matched = ")";
718
- break found;
719
- }
720
- break;
915
+ break;
916
+ case 3046192:
917
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 1)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 2)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69)) {
918
+ wordId = 41;
919
+ return j;
721
920
  }
722
- case 9: {
723
- if (code2 === 42) {
724
- id = 79;
725
- end = offset + 1;
726
- matched = "*";
727
- break found;
728
- }
729
- break;
921
+ break;
922
+ case 3046207:
923
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 1)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 2)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 3)) === 116 || c === 84)) {
924
+ wordId = 51;
925
+ return j;
926
+ }
927
+ break;
928
+ }
929
+ }
930
+ if (j === offset) j++;
931
+ while (j < length) {
932
+ c = text.charCodeAt(j);
933
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
934
+ j++;
935
+ }
936
+ wordId = 62;
937
+ return j;
938
+ }
939
+ function word3(text, offset, length) {
940
+ let c = text.charCodeAt(offset);
941
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
942
+ let h = 0;
943
+ let j = offset;
944
+ while (j < length) {
945
+ c = text.charCodeAt(j);
946
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
947
+ if (c >= 65 && c <= 90) c += 32;
948
+ h = Math.imul(h, 31) + c | 0;
949
+ j++;
950
+ }
951
+ const len = j - offset;
952
+ if (len > 0) {
953
+ switch (h) {
954
+ case 288698108:
955
+ if (len === 8 && ((c = text.charCodeAt(offset + 0)) === 100 || c === 68) && ((c = text.charCodeAt(offset + 1)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 2)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 3)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 4)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 5)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 6)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 7)) === 116 || c === 84)) {
956
+ wordId = 7;
957
+ return j;
958
+ }
959
+ break;
960
+ case 3079825:
961
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 100 || c === 68) && ((c = text.charCodeAt(offset + 1)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 2)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 3)) === 99 || c === 67)) {
962
+ wordId = 31;
963
+ return j;
964
+ }
965
+ break;
966
+ }
967
+ }
968
+ if (j === offset) j++;
969
+ while (j < length) {
970
+ c = text.charCodeAt(j);
971
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
972
+ j++;
973
+ }
974
+ wordId = 62;
975
+ return j;
976
+ }
977
+ function word4(text, offset, length) {
978
+ let c = text.charCodeAt(offset);
979
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
980
+ let h = 0;
981
+ let j = offset;
982
+ while (j < length) {
983
+ c = text.charCodeAt(j);
984
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
985
+ if (c >= 65 && c <= 90) c += 32;
986
+ h = Math.imul(h, 31) + c | 0;
987
+ j++;
988
+ }
989
+ const len = j - offset;
990
+ if (len > 0) {
991
+ switch (h) {
992
+ case 3116345:
993
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 1)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 2)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69)) {
994
+ wordId = 44;
995
+ return j;
996
+ }
997
+ break;
998
+ case 100571:
999
+ if (len === 3 && ((c = text.charCodeAt(offset + 0)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 100 || c === 68)) {
1000
+ wordId = 45;
1001
+ return j;
1002
+ }
1003
+ break;
1004
+ case -1289550567:
1005
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 1)) === 120 || c === 88) && ((c = text.charCodeAt(offset + 2)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 112 || c === 80) && ((c = text.charCodeAt(offset + 5)) === 116 || c === 84)) {
1006
+ wordId = 48;
1007
+ return j;
1008
+ }
1009
+ break;
1010
+ case -1289358244:
1011
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 1)) === 120 || c === 88) && ((c = text.charCodeAt(offset + 2)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 3)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 4)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 5)) === 115 || c === 83)) {
1012
+ wordId = 50;
1013
+ return j;
1014
+ }
1015
+ break;
1016
+ case -1305289599:
1017
+ if (len === 7 && ((c = text.charCodeAt(offset + 0)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 1)) === 120 || c === 88) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 3)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 4)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 5)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 6)) === 116 || c === 84)) {
1018
+ wordId = 52;
1019
+ return j;
1020
+ }
1021
+ break;
1022
+ }
1023
+ }
1024
+ if (j === offset) j++;
1025
+ while (j < length) {
1026
+ c = text.charCodeAt(j);
1027
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1028
+ j++;
1029
+ }
1030
+ wordId = 62;
1031
+ return j;
1032
+ }
1033
+ function word5(text, offset, length) {
1034
+ let c = text.charCodeAt(offset);
1035
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1036
+ let h = 0;
1037
+ let j = offset;
1038
+ while (j < length) {
1039
+ c = text.charCodeAt(j);
1040
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1041
+ if (c >= 65 && c <= 90) c += 32;
1042
+ h = Math.imul(h, 31) + c | 0;
1043
+ j++;
1044
+ }
1045
+ const len = j - offset;
1046
+ if (len > 0) {
1047
+ switch (h) {
1048
+ case 3151786:
1049
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 1)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 2)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 3)) === 109 || c === 77)) {
1050
+ wordId = 4;
1051
+ return j;
1052
+ }
1053
+ break;
1054
+ case 3154575:
1055
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 1)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 108 || c === 76)) {
1056
+ wordId = 21;
1057
+ return j;
1058
+ }
1059
+ break;
1060
+ case 97196323:
1061
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 1)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69)) {
1062
+ wordId = 40;
1063
+ return j;
1064
+ }
1065
+ break;
1066
+ case -1274492040:
1067
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 1)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 5)) === 114 || c === 82)) {
1068
+ wordId = 55;
1069
+ return j;
1070
+ }
1071
+ break;
1072
+ case 101577:
1073
+ if (len === 3 && ((c = text.charCodeAt(offset + 0)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 1)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 2)) === 114 || c === 82)) {
1074
+ wordId = 56;
1075
+ return j;
1076
+ }
1077
+ break;
1078
+ }
1079
+ }
1080
+ if (j === offset) j++;
1081
+ while (j < length) {
1082
+ c = text.charCodeAt(j);
1083
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1084
+ j++;
1085
+ }
1086
+ wordId = 62;
1087
+ return j;
1088
+ }
1089
+ function word6(text, offset, length) {
1090
+ let c = text.charCodeAt(offset);
1091
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1092
+ let h = 0;
1093
+ let j = offset;
1094
+ while (j < length) {
1095
+ c = text.charCodeAt(j);
1096
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1097
+ if (c >= 65 && c <= 90) c += 32;
1098
+ h = Math.imul(h, 31) + c | 0;
1099
+ j++;
1100
+ }
1101
+ const len = j - offset;
1102
+ if (len > 0) {
1103
+ switch (h) {
1104
+ case 98629247:
1105
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 103 || c === 71) && ((c = text.charCodeAt(offset + 1)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 2)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 3)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 4)) === 112 || c === 80)) {
1106
+ wordId = 27;
1107
+ return j;
1108
+ }
1109
+ break;
1110
+ }
1111
+ }
1112
+ if (j === offset) j++;
1113
+ while (j < length) {
1114
+ c = text.charCodeAt(j);
1115
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1116
+ j++;
1117
+ }
1118
+ wordId = 62;
1119
+ return j;
1120
+ }
1121
+ function word7(text, offset, length) {
1122
+ let c = text.charCodeAt(offset);
1123
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1124
+ let h = 0;
1125
+ let j = offset;
1126
+ while (j < length) {
1127
+ c = text.charCodeAt(j);
1128
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1129
+ if (c >= 65 && c <= 90) c += 32;
1130
+ h = Math.imul(h, 31) + c | 0;
1131
+ j++;
1132
+ }
1133
+ const len = j - offset;
1134
+ if (len > 0) {
1135
+ switch (h) {
1136
+ case -1224334299:
1137
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 104 || c === 72) && ((c = text.charCodeAt(offset + 1)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 2)) === 118 || c === 86) && ((c = text.charCodeAt(offset + 3)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 4)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 5)) === 103 || c === 71)) {
1138
+ wordId = 33;
1139
+ return j;
1140
+ }
1141
+ break;
1142
+ }
1143
+ }
1144
+ if (j === offset) j++;
1145
+ while (j < length) {
1146
+ c = text.charCodeAt(j);
1147
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1148
+ j++;
1149
+ }
1150
+ wordId = 62;
1151
+ return j;
1152
+ }
1153
+ function word8(text, offset, length) {
1154
+ let c = text.charCodeAt(offset);
1155
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1156
+ let h = 0;
1157
+ let j = offset;
1158
+ while (j < length) {
1159
+ c = text.charCodeAt(j);
1160
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1161
+ if (c >= 65 && c <= 90) c += 32;
1162
+ h = Math.imul(h, 31) + c | 0;
1163
+ j++;
1164
+ }
1165
+ const len = j - offset;
1166
+ if (len > 0) {
1167
+ switch (h) {
1168
+ case 3365:
1169
+ if (len === 2 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78)) {
1170
+ wordId = 12;
1171
+ return j;
1172
+ }
1173
+ break;
1174
+ case 3370:
1175
+ if (len === 2 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 115 || c === 83)) {
1176
+ wordId = 13;
1177
+ return j;
1178
+ }
1179
+ break;
1180
+ case 100291456:
1181
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 2)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 3)) === 107 || c === 75) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69)) {
1182
+ wordId = 16;
1183
+ return j;
1184
+ }
1185
+ break;
1186
+ case 100355670:
1187
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 114 || c === 82)) {
1188
+ wordId = 18;
1189
+ return j;
1190
+ }
1191
+ break;
1192
+ case -1183792455:
1193
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 5)) === 116 || c === 84)) {
1194
+ wordId = 36;
1195
+ return j;
1196
+ }
1197
+ break;
1198
+ case 3237472:
1199
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 3)) === 111 || c === 79)) {
1200
+ wordId = 37;
1201
+ return j;
1202
+ }
1203
+ break;
1204
+ case 503014687:
1205
+ if (len === 9 && ((c = text.charCodeAt(offset + 0)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 5)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 6)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 7)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 8)) === 116 || c === 84)) {
1206
+ wordId = 49;
1207
+ return j;
1208
+ }
1209
+ break;
1210
+ }
1211
+ }
1212
+ if (j === offset) j++;
1213
+ while (j < length) {
1214
+ c = text.charCodeAt(j);
1215
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1216
+ j++;
1217
+ }
1218
+ wordId = 62;
1219
+ return j;
1220
+ }
1221
+ function word9(text, offset, length) {
1222
+ let c = text.charCodeAt(offset);
1223
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1224
+ let h = 0;
1225
+ let j = offset;
1226
+ while (j < length) {
1227
+ c = text.charCodeAt(j);
1228
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1229
+ if (c >= 65 && c <= 90) c += 32;
1230
+ h = Math.imul(h, 31) + c | 0;
1231
+ j++;
1232
+ }
1233
+ const len = j - offset;
1234
+ if (len > 0) {
1235
+ switch (h) {
1236
+ case 3267882:
1237
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 106 || c === 74) && ((c = text.charCodeAt(offset + 1)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 2)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 3)) === 110 || c === 78)) {
1238
+ wordId = 24;
1239
+ return j;
1240
+ }
1241
+ break;
1242
+ }
1243
+ }
1244
+ if (j === offset) j++;
1245
+ while (j < length) {
1246
+ c = text.charCodeAt(j);
1247
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1248
+ j++;
1249
+ }
1250
+ wordId = 62;
1251
+ return j;
1252
+ }
1253
+ function word10(text, offset, length) {
1254
+ let c = text.charCodeAt(offset);
1255
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1256
+ let h = 0;
1257
+ let j = offset;
1258
+ while (j < length) {
1259
+ c = text.charCodeAt(j);
1260
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1261
+ if (c >= 65 && c <= 90) c += 32;
1262
+ h = Math.imul(h, 31) + c | 0;
1263
+ j++;
1264
+ }
1265
+ const len = j - offset;
1266
+ if (len > 0) {
1267
+ switch (h) {
1268
+ case 3321751:
1269
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 1)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 2)) === 107 || c === 75) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69)) {
1270
+ wordId = 15;
1271
+ return j;
730
1272
  }
731
- case 10: {
732
- if (code2 === 43) {
733
- id = 77;
734
- end = offset + 1;
735
- matched = "+";
736
- break found;
737
- }
738
- break;
1273
+ break;
1274
+ case 3317767:
1275
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 1)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 2)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 3)) === 116 || c === 84)) {
1276
+ wordId = 19;
1277
+ return j;
739
1278
  }
740
- case 11: {
741
- if (code2 === 44) {
742
- id = 86;
743
- end = offset + 1;
744
- matched = ",";
745
- break found;
746
- }
747
- break;
1279
+ break;
1280
+ case 102976443:
1281
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 1)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 2)) === 109 || c === 77) && ((c = text.charCodeAt(offset + 3)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 4)) === 116 || c === 84)) {
1282
+ wordId = 34;
1283
+ return j;
748
1284
  }
749
- case 12: {
750
- if (text.startsWith("--", offset)) {
751
- let j = offset + 2;
752
- while (j < length) {
753
- const c = text.charCodeAt(j);
754
- if (c === 10) break;
755
- j++;
756
- }
757
- id = 1;
758
- end = j;
759
- matched = null;
760
- break found;
761
- }
762
- if (text.startsWith("->>", offset)) {
763
- id = 64;
764
- end = offset + 3;
765
- matched = "->>";
766
- break found;
767
- }
768
- if (text.startsWith("->", offset)) {
769
- id = 65;
770
- end = offset + 2;
771
- matched = "->";
772
- break found;
773
- }
774
- if (code2 === 45) {
775
- id = 78;
776
- end = offset + 1;
777
- matched = "-";
778
- break found;
779
- }
780
- break;
1285
+ break;
1286
+ }
1287
+ }
1288
+ if (j === offset) j++;
1289
+ while (j < length) {
1290
+ c = text.charCodeAt(j);
1291
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1292
+ j++;
1293
+ }
1294
+ wordId = 62;
1295
+ return j;
1296
+ }
1297
+ function word11(text, offset, length) {
1298
+ let c = text.charCodeAt(offset);
1299
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1300
+ let h = 0;
1301
+ let j = offset;
1302
+ while (j < length) {
1303
+ c = text.charCodeAt(j);
1304
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1305
+ if (c >= 65 && c <= 90) c += 32;
1306
+ h = Math.imul(h, 31) + c | 0;
1307
+ j++;
1308
+ }
1309
+ const len = j - offset;
1310
+ if (len > 0) {
1311
+ switch (h) {
1312
+ case 109267:
1313
+ if (len === 3 && ((c = text.charCodeAt(offset + 0)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 1)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84)) {
1314
+ wordId = 11;
1315
+ return j;
781
1316
  }
782
- case 13: {
783
- RX[2].lastIndex = offset;
784
- m = RX[2].exec(text);
785
- if (m !== null && m[0].length > 0) {
786
- id = 58;
787
- matched = m[0];
788
- end = offset + matched.length;
789
- break found;
790
- }
791
- if (code2 === 46) {
792
- id = 87;
793
- end = offset + 1;
794
- matched = ".";
795
- break found;
796
- }
797
- break;
1317
+ break;
1318
+ case 3392903:
1319
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 1)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 108 || c === 76)) {
1320
+ wordId = 14;
1321
+ return j;
798
1322
  }
799
- case 14: {
800
- RX[3].lastIndex = offset;
801
- if (RX[3].test(text) && RX[3].lastIndex > offset) {
802
- id = 2;
803
- end = RX[3].lastIndex;
804
- matched = null;
805
- break found;
806
- }
807
- if (code2 === 47) {
808
- id = 80;
809
- end = offset + 1;
810
- matched = "/";
811
- break found;
812
- }
813
- break;
1323
+ break;
1324
+ case 105180108:
1325
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 1)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 4)) === 115 || c === 83)) {
1326
+ wordId = 32;
1327
+ return j;
814
1328
  }
815
- case 15: {
816
- RX[2].lastIndex = offset;
817
- m = RX[2].exec(text);
818
- if (m !== null && m[0].length > 0) {
819
- id = 58;
820
- matched = m[0];
821
- end = offset + matched.length;
822
- break found;
823
- }
824
- break;
1329
+ break;
1330
+ }
1331
+ }
1332
+ if (j === offset) j++;
1333
+ while (j < length) {
1334
+ c = text.charCodeAt(j);
1335
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1336
+ j++;
1337
+ }
1338
+ wordId = 62;
1339
+ return j;
1340
+ }
1341
+ function word12(text, offset, length) {
1342
+ let c = text.charCodeAt(offset);
1343
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1344
+ let h = 0;
1345
+ let j = offset;
1346
+ while (j < length) {
1347
+ c = text.charCodeAt(j);
1348
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1349
+ if (c >= 65 && c <= 90) c += 32;
1350
+ h = Math.imul(h, 31) + c | 0;
1351
+ j++;
1352
+ }
1353
+ const len = j - offset;
1354
+ if (len > 0) {
1355
+ switch (h) {
1356
+ case 3555:
1357
+ if (len === 2 && ((c = text.charCodeAt(offset + 0)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 1)) === 114 || c === 82)) {
1358
+ wordId = 10;
1359
+ return j;
825
1360
  }
826
- case 16: {
827
- if (text.startsWith("::", offset)) {
828
- id = 66;
829
- end = offset + 2;
830
- matched = "::";
831
- break found;
832
- }
833
- RX[4].lastIndex = offset;
834
- m = RX[4].exec(text);
835
- if (m !== null && m[0].length > 0) {
836
- id = 67;
837
- matched = m[0];
838
- end = offset + matched.length;
839
- break found;
840
- }
841
- break;
1361
+ break;
1362
+ case 106111099:
1363
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 1)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 114 || c === 82)) {
1364
+ wordId = 22;
1365
+ return j;
842
1366
  }
843
- case 17: {
844
- if (code2 === 59) {
845
- id = 88;
846
- end = offset + 1;
847
- matched = ";";
848
- break found;
849
- }
850
- break;
1367
+ break;
1368
+ case 3551:
1369
+ if (len === 2 && ((c = text.charCodeAt(offset + 0)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78)) {
1370
+ wordId = 25;
1371
+ return j;
851
1372
  }
852
- case 18: {
853
- if (text.startsWith("<>", offset)) {
854
- id = 69;
855
- end = offset + 2;
856
- matched = "<>";
857
- break found;
858
- }
859
- if (text.startsWith("<=", offset)) {
860
- id = 70;
861
- end = offset + 2;
862
- matched = "<=";
863
- break found;
864
- }
865
- if (code2 === 60) {
866
- id = 74;
867
- end = offset + 1;
868
- matched = "<";
869
- break found;
870
- }
871
- break;
1373
+ break;
1374
+ case 106006350:
1375
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 1)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 2)) === 100 || c === 68) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 114 || c === 82)) {
1376
+ wordId = 29;
1377
+ return j;
872
1378
  }
873
- case 19: {
874
- if (text.startsWith("==", offset)) {
875
- id = 73;
876
- end = offset + 2;
877
- matched = "==";
878
- break found;
879
- }
880
- if (code2 === 61) {
881
- id = 76;
882
- end = offset + 1;
883
- matched = "=";
884
- break found;
885
- }
886
- break;
1379
+ break;
1380
+ case -1019779949:
1381
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 1)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 2)) === 102 || c === 70) && ((c = text.charCodeAt(offset + 3)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 5)) === 116 || c === 84)) {
1382
+ wordId = 35;
1383
+ return j;
887
1384
  }
888
- case 20: {
889
- if (text.startsWith(">=", offset)) {
890
- id = 71;
891
- end = offset + 2;
892
- matched = ">=";
893
- break found;
894
- }
895
- if (code2 === 62) {
896
- id = 75;
897
- end = offset + 1;
898
- matched = ">";
899
- break found;
900
- }
901
- break;
1385
+ break;
1386
+ case 3423444:
1387
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 1)) === 118 || c === 86) && ((c = text.charCodeAt(offset + 2)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 3)) === 114 || c === 82)) {
1388
+ wordId = 53;
1389
+ return j;
902
1390
  }
903
- case 21: {
904
- if (code2 === 63) {
905
- id = 89;
906
- end = offset + 1;
907
- matched = "?";
908
- break found;
909
- }
910
- break;
1391
+ break;
1392
+ }
1393
+ }
1394
+ if (j === offset) j++;
1395
+ while (j < length) {
1396
+ c = text.charCodeAt(j);
1397
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1398
+ j++;
1399
+ }
1400
+ wordId = 62;
1401
+ return j;
1402
+ }
1403
+ function word13(text, offset, length) {
1404
+ let c = text.charCodeAt(offset);
1405
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1406
+ let h = 0;
1407
+ let j = offset;
1408
+ while (j < length) {
1409
+ c = text.charCodeAt(j);
1410
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1411
+ if (c >= 65 && c <= 90) c += 32;
1412
+ h = Math.imul(h, 31) + c | 0;
1413
+ j++;
1414
+ }
1415
+ const len = j - offset;
1416
+ if (len > 0) {
1417
+ switch (h) {
1418
+ case 108511772:
1419
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 1)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 2)) === 103 || c === 71) && ((c = text.charCodeAt(offset + 3)) === 104 || c === 72) && ((c = text.charCodeAt(offset + 4)) === 116 || c === 84)) {
1420
+ wordId = 20;
1421
+ return j;
911
1422
  }
912
- case 22: {
913
- {
914
- const e = scanKeyword(text, offset, length, KW[0][0], KW[0][1], look0);
915
- if (e !== -1) {
916
- id = 6;
917
- end = e;
918
- matched = null;
919
- break found;
920
- }
921
- }
922
- {
923
- const e = scanKeyword(text, offset, length, KW[1][0], KW[1][1], look0);
924
- if (e !== -1) {
925
- id = 8;
926
- end = e;
927
- matched = null;
928
- break found;
929
- }
930
- }
931
- {
932
- const e = scanKeyword(text, offset, length, KW[2][0], KW[2][1], look0);
933
- if (e !== -1) {
934
- id = 9;
935
- end = e;
936
- matched = null;
937
- break found;
938
- }
939
- }
940
- {
941
- const e = scanKeyword(text, offset, length, KW[3][0], KW[3][1], look0);
942
- if (e !== -1) {
943
- id = 30;
944
- end = e;
945
- matched = null;
946
- break found;
947
- }
948
- }
949
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
950
- let j = offset + 1;
951
- while (j < length) {
952
- const c = text.charCodeAt(j);
953
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
954
- j++;
955
- }
956
- id = 62;
957
- end = j;
958
- matched = null;
959
- break found;
960
- }
961
- break;
1423
+ break;
1424
+ }
1425
+ }
1426
+ if (j === offset) j++;
1427
+ while (j < length) {
1428
+ c = text.charCodeAt(j);
1429
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1430
+ j++;
1431
+ }
1432
+ wordId = 62;
1433
+ return j;
1434
+ }
1435
+ function word14(text, offset, length) {
1436
+ let c = text.charCodeAt(offset);
1437
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1438
+ let h = 0;
1439
+ let j = offset;
1440
+ while (j < length) {
1441
+ c = text.charCodeAt(j);
1442
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1443
+ if (c >= 65 && c <= 90) c += 32;
1444
+ h = Math.imul(h, 31) + c | 0;
1445
+ j++;
1446
+ }
1447
+ const len = j - offset;
1448
+ if (len > 0) {
1449
+ switch (h) {
1450
+ case -906021636:
1451
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 1)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 4)) === 99 || c === 67) && ((c = text.charCodeAt(offset + 5)) === 116 || c === 84)) {
1452
+ wordId = 3;
1453
+ return j;
962
1454
  }
963
- case 23: {
964
- {
965
- const e = scanKeyword(text, offset, length, KW[4][0], KW[4][1], look0);
966
- if (e !== -1) {
967
- id = 17;
968
- end = e;
969
- matched = null;
970
- break found;
971
- }
972
- }
973
- {
974
- const e = scanKeyword(text, offset, length, KW[5][0], KW[5][1], look0);
975
- if (e !== -1) {
976
- id = 28;
977
- end = e;
978
- matched = null;
979
- break found;
980
- }
981
- }
982
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
983
- let j = offset + 1;
984
- while (j < length) {
985
- const c = text.charCodeAt(j);
986
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
987
- j++;
988
- }
989
- id = 62;
990
- end = j;
991
- matched = null;
992
- break found;
993
- }
994
- break;
1455
+ break;
1456
+ }
1457
+ }
1458
+ if (j === offset) j++;
1459
+ while (j < length) {
1460
+ c = text.charCodeAt(j);
1461
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1462
+ j++;
1463
+ }
1464
+ wordId = 62;
1465
+ return j;
1466
+ }
1467
+ function word15(text, offset, length) {
1468
+ let c = text.charCodeAt(offset);
1469
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1470
+ let h = 0;
1471
+ let j = offset;
1472
+ while (j < length) {
1473
+ c = text.charCodeAt(j);
1474
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1475
+ if (c >= 65 && c <= 90) c += 32;
1476
+ h = Math.imul(h, 31) + c | 0;
1477
+ j++;
1478
+ }
1479
+ const len = j - offset;
1480
+ if (len > 0) {
1481
+ switch (h) {
1482
+ case 3569038:
1483
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 1)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 2)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 3)) === 101 || c === 69)) {
1484
+ wordId = 39;
1485
+ return j;
995
1486
  }
996
- case 24: {
997
- {
998
- const e = scanKeyword(text, offset, length, KW[6][0], KW[6][1], look0);
999
- if (e !== -1) {
1000
- id = 23;
1001
- end = e;
1002
- matched = null;
1003
- break found;
1004
- }
1005
- }
1006
- {
1007
- const e = scanKeyword(text, offset, length, KW[7][0], KW[7][1], look0);
1008
- if (e !== -1) {
1009
- id = 41;
1010
- end = e;
1011
- matched = null;
1012
- break found;
1013
- }
1014
- }
1015
- {
1016
- const e = scanKeyword(text, offset, length, KW[8][0], KW[8][1], look0);
1017
- if (e !== -1) {
1018
- id = 51;
1019
- end = e;
1020
- matched = null;
1021
- break found;
1022
- }
1023
- }
1024
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1025
- let j = offset + 1;
1026
- while (j < length) {
1027
- const c = text.charCodeAt(j);
1028
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1029
- j++;
1030
- }
1031
- id = 62;
1032
- end = j;
1033
- matched = null;
1034
- break found;
1035
- }
1036
- break;
1487
+ break;
1488
+ case 3558941:
1489
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 1)) === 104 || c === 72) && ((c = text.charCodeAt(offset + 2)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 3)) === 110 || c === 78)) {
1490
+ wordId = 43;
1491
+ return j;
1037
1492
  }
1038
- case 25: {
1039
- {
1040
- const e = scanKeyword(text, offset, length, KW[9][0], KW[9][1], look0);
1041
- if (e !== -1) {
1042
- id = 7;
1043
- end = e;
1044
- matched = null;
1045
- break found;
1046
- }
1047
- }
1048
- {
1049
- const e = scanKeyword(text, offset, length, KW[10][0], KW[10][1], look0);
1050
- if (e !== -1) {
1051
- id = 31;
1052
- end = e;
1053
- matched = null;
1054
- break found;
1055
- }
1056
- }
1057
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1058
- let j = offset + 1;
1059
- while (j < length) {
1060
- const c = text.charCodeAt(j);
1061
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1062
- j++;
1063
- }
1064
- id = 62;
1065
- end = j;
1066
- matched = null;
1067
- break found;
1068
- }
1069
- break;
1493
+ break;
1494
+ }
1495
+ }
1496
+ if (j === offset) j++;
1497
+ while (j < length) {
1498
+ c = text.charCodeAt(j);
1499
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1500
+ j++;
1501
+ }
1502
+ wordId = 62;
1503
+ return j;
1504
+ }
1505
+ function word16(text, offset, length) {
1506
+ let c = text.charCodeAt(offset);
1507
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1508
+ let h = 0;
1509
+ let j = offset;
1510
+ while (j < length) {
1511
+ c = text.charCodeAt(j);
1512
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1513
+ if (c >= 65 && c <= 90) c += 32;
1514
+ h = Math.imul(h, 31) + c | 0;
1515
+ j++;
1516
+ }
1517
+ const len = j - offset;
1518
+ if (len > 0) {
1519
+ switch (h) {
1520
+ case 111582340:
1521
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 1)) === 115 || c === 83) && ((c = text.charCodeAt(offset + 2)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 3)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 4)) === 103 || c === 71)) {
1522
+ wordId = 26;
1523
+ return j;
1070
1524
  }
1071
- case 26: {
1072
- {
1073
- const e = scanKeyword(text, offset, length, KW[11][0], KW[11][1], look0);
1074
- if (e !== -1) {
1075
- id = 44;
1076
- end = e;
1077
- matched = null;
1078
- break found;
1079
- }
1080
- }
1081
- {
1082
- const e = scanKeyword(text, offset, length, KW[12][0], KW[12][1], look0);
1083
- if (e !== -1) {
1084
- id = 45;
1085
- end = e;
1086
- matched = null;
1087
- break found;
1088
- }
1089
- }
1090
- {
1091
- const e = scanKeyword(text, offset, length, KW[13][0], KW[13][1], look0);
1092
- if (e !== -1) {
1093
- id = 48;
1094
- end = e;
1095
- matched = null;
1096
- break found;
1097
- }
1098
- }
1099
- {
1100
- const e = scanKeyword(text, offset, length, KW[14][0], KW[14][1], look0);
1101
- if (e !== -1) {
1102
- id = 50;
1103
- end = e;
1104
- matched = null;
1105
- break found;
1106
- }
1107
- }
1525
+ break;
1526
+ case 111433423:
1527
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 1)) === 110 || c === 78) && ((c = text.charCodeAt(offset + 2)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 3)) === 111 || c === 79) && ((c = text.charCodeAt(offset + 4)) === 110 || c === 78)) {
1528
+ wordId = 47;
1529
+ return j;
1530
+ }
1531
+ break;
1532
+ }
1533
+ }
1534
+ if (j === offset) j++;
1535
+ while (j < length) {
1536
+ c = text.charCodeAt(j);
1537
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1538
+ j++;
1539
+ }
1540
+ wordId = 62;
1541
+ return j;
1542
+ }
1543
+ function word17(text, offset, length) {
1544
+ let c = text.charCodeAt(offset);
1545
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1546
+ let h = 0;
1547
+ let j = offset;
1548
+ while (j < length) {
1549
+ c = text.charCodeAt(j);
1550
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1551
+ if (c >= 65 && c <= 90) c += 32;
1552
+ h = Math.imul(h, 31) + c | 0;
1553
+ j++;
1554
+ }
1555
+ const len = j - offset;
1556
+ if (len > 0) {
1557
+ switch (h) {
1558
+ case -823812830:
1559
+ if (len === 6 && ((c = text.charCodeAt(offset + 0)) === 118 || c === 86) && ((c = text.charCodeAt(offset + 1)) === 97 || c === 65) && ((c = text.charCodeAt(offset + 2)) === 108 || c === 76) && ((c = text.charCodeAt(offset + 3)) === 117 || c === 85) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 5)) === 115 || c === 83)) {
1560
+ wordId = 38;
1561
+ return j;
1562
+ }
1563
+ break;
1564
+ }
1565
+ }
1566
+ if (j === offset) j++;
1567
+ while (j < length) {
1568
+ c = text.charCodeAt(j);
1569
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1570
+ j++;
1571
+ }
1572
+ wordId = 62;
1573
+ return j;
1574
+ }
1575
+ function word18(text, offset, length) {
1576
+ let c = text.charCodeAt(offset);
1577
+ if (!(c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) return -1;
1578
+ let h = 0;
1579
+ let j = offset;
1580
+ while (j < length) {
1581
+ c = text.charCodeAt(j);
1582
+ if (!(c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1583
+ if (c >= 65 && c <= 90) c += 32;
1584
+ h = Math.imul(h, 31) + c | 0;
1585
+ j++;
1586
+ }
1587
+ const len = j - offset;
1588
+ if (len > 0) {
1589
+ switch (h) {
1590
+ case 113097959:
1591
+ if (len === 5 && ((c = text.charCodeAt(offset + 0)) === 119 || c === 87) && ((c = text.charCodeAt(offset + 1)) === 104 || c === 72) && ((c = text.charCodeAt(offset + 2)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 3)) === 114 || c === 82) && ((c = text.charCodeAt(offset + 4)) === 101 || c === 69)) {
1592
+ wordId = 5;
1593
+ return j;
1594
+ }
1595
+ break;
1596
+ case 3648314:
1597
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 119 || c === 87) && ((c = text.charCodeAt(offset + 1)) === 104 || c === 72) && ((c = text.charCodeAt(offset + 2)) === 101 || c === 69) && ((c = text.charCodeAt(offset + 3)) === 110 || c === 78)) {
1598
+ wordId = 42;
1599
+ return j;
1600
+ }
1601
+ break;
1602
+ case 3649734:
1603
+ if (len === 4 && ((c = text.charCodeAt(offset + 0)) === 119 || c === 87) && ((c = text.charCodeAt(offset + 1)) === 105 || c === 73) && ((c = text.charCodeAt(offset + 2)) === 116 || c === 84) && ((c = text.charCodeAt(offset + 3)) === 104 || c === 72)) {
1604
+ wordId = 46;
1605
+ return j;
1606
+ }
1607
+ break;
1608
+ }
1609
+ }
1610
+ if (j === offset) j++;
1611
+ while (j < length) {
1612
+ c = text.charCodeAt(j);
1613
+ if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1614
+ j++;
1615
+ }
1616
+ wordId = 62;
1617
+ return j;
1618
+ }
1619
+ function tokenize2(text) {
1620
+ if (typeof text !== "string") throw new TypeError("tokenize: expected a string");
1621
+ const tokens_ = [];
1622
+ let offset = 0;
1623
+ let line = 1;
1624
+ let lineStart = 0;
1625
+ const length = text.length;
1626
+ let m = null;
1627
+ while (offset < length) {
1628
+ const code2 = text.charCodeAt(offset);
1629
+ let id = -1;
1630
+ let end = -1;
1631
+ let matched = null;
1632
+ found: {
1633
+ switch (DISPATCH.charCodeAt(code2 < 128 ? code2 : 128) - 256) {
1634
+ case 1: {
1108
1635
  {
1109
- const e = scanKeyword(text, offset, length, KW[15][0], KW[15][1], look0);
1110
- if (e !== -1) {
1111
- id = 52;
1636
+ const e = scan0(text, offset, length);
1637
+ if (e === -2) {
1638
+ RX[0].lastIndex = offset;
1639
+ if (RX[0].test(text) && RX[0].lastIndex > offset) {
1640
+ id = 0;
1641
+ end = RX[0].lastIndex;
1642
+ matched = null;
1643
+ break found;
1644
+ }
1645
+ } else if (e !== -1) {
1646
+ id = 0;
1112
1647
  end = e;
1113
1648
  matched = null;
1114
1649
  break found;
1115
1650
  }
1116
1651
  }
1117
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1118
- let j = offset + 1;
1119
- while (j < length) {
1120
- const c = text.charCodeAt(j);
1121
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1122
- j++;
1123
- }
1124
- id = 62;
1125
- end = j;
1126
- matched = null;
1127
- break found;
1128
- }
1129
1652
  break;
1130
1653
  }
1131
- case 27: {
1132
- {
1133
- const e = scanKeyword(text, offset, length, KW[16][0], KW[16][1], look0);
1134
- if (e !== -1) {
1135
- id = 4;
1136
- end = e;
1137
- matched = null;
1138
- break found;
1139
- }
1140
- }
1141
- {
1142
- const e = scanKeyword(text, offset, length, KW[17][0], KW[17][1], look0);
1143
- if (e !== -1) {
1144
- id = 21;
1145
- end = e;
1146
- matched = null;
1147
- break found;
1148
- }
1149
- }
1150
- {
1151
- const e = scanKeyword(text, offset, length, KW[18][0], KW[18][1], look0);
1152
- if (e !== -1) {
1153
- id = 40;
1154
- end = e;
1155
- matched = null;
1156
- break found;
1157
- }
1654
+ case 2: {
1655
+ if (text.startsWith("!=", offset)) {
1656
+ id = 72;
1657
+ end = offset + 2;
1658
+ matched = "!=";
1659
+ break found;
1158
1660
  }
1661
+ break;
1662
+ }
1663
+ case 3: {
1159
1664
  {
1160
- const e = scanKeyword(text, offset, length, KW[19][0], KW[19][1], look0);
1665
+ const e = scan60(text, offset);
1161
1666
  if (e !== -1) {
1162
- id = 55;
1667
+ id = 60;
1163
1668
  end = e;
1164
1669
  matched = null;
1165
1670
  break found;
1166
1671
  }
1167
1672
  }
1673
+ break;
1674
+ }
1675
+ case 4: {
1168
1676
  {
1169
- const e = scanKeyword(text, offset, length, KW[20][0], KW[20][1], look0);
1677
+ const e = dfa0(text, offset, length);
1170
1678
  if (e !== -1) {
1171
- id = 56;
1679
+ id = dfaId;
1172
1680
  end = e;
1173
1681
  matched = null;
1174
1682
  break found;
1175
1683
  }
1176
1684
  }
1177
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1178
- let j = offset + 1;
1179
- while (j < length) {
1180
- const c = text.charCodeAt(j);
1181
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1182
- j++;
1183
- }
1184
- id = 62;
1185
- end = j;
1186
- matched = null;
1685
+ break;
1686
+ }
1687
+ case 5: {
1688
+ if (code2 === 37) {
1689
+ id = 81;
1690
+ end = offset + 1;
1691
+ matched = "%";
1187
1692
  break found;
1188
1693
  }
1189
1694
  break;
1190
1695
  }
1191
- case 28: {
1696
+ case 6: {
1192
1697
  {
1193
- const e = scanKeyword(text, offset, length, KW[21][0], KW[21][1], look0);
1698
+ const e = scan59(text, offset);
1194
1699
  if (e !== -1) {
1195
- id = 27;
1700
+ id = 59;
1196
1701
  end = e;
1197
1702
  matched = null;
1198
1703
  break found;
1199
1704
  }
1200
1705
  }
1201
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1202
- let j = offset + 1;
1706
+ break;
1707
+ }
1708
+ case 7: {
1709
+ if (code2 === 40) {
1710
+ id = 82;
1711
+ end = offset + 1;
1712
+ matched = "(";
1713
+ break found;
1714
+ }
1715
+ break;
1716
+ }
1717
+ case 8: {
1718
+ if (code2 === 41) {
1719
+ id = 83;
1720
+ end = offset + 1;
1721
+ matched = ")";
1722
+ break found;
1723
+ }
1724
+ break;
1725
+ }
1726
+ case 9: {
1727
+ if (code2 === 42) {
1728
+ id = 79;
1729
+ end = offset + 1;
1730
+ matched = "*";
1731
+ break found;
1732
+ }
1733
+ break;
1734
+ }
1735
+ case 10: {
1736
+ if (code2 === 43) {
1737
+ id = 77;
1738
+ end = offset + 1;
1739
+ matched = "+";
1740
+ break found;
1741
+ }
1742
+ break;
1743
+ }
1744
+ case 11: {
1745
+ if (code2 === 44) {
1746
+ id = 86;
1747
+ end = offset + 1;
1748
+ matched = ",";
1749
+ break found;
1750
+ }
1751
+ break;
1752
+ }
1753
+ case 12: {
1754
+ if (text.startsWith("--", offset)) {
1755
+ let j = offset + 2;
1203
1756
  while (j < length) {
1204
1757
  const c = text.charCodeAt(j);
1205
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1758
+ if (c === 10) break;
1206
1759
  j++;
1207
1760
  }
1208
- id = 62;
1761
+ id = 1;
1209
1762
  end = j;
1210
1763
  matched = null;
1211
1764
  break found;
1212
1765
  }
1766
+ if (text.startsWith("->>", offset)) {
1767
+ id = 64;
1768
+ end = offset + 3;
1769
+ matched = "->>";
1770
+ break found;
1771
+ }
1772
+ if (text.startsWith("->", offset)) {
1773
+ id = 65;
1774
+ end = offset + 2;
1775
+ matched = "->";
1776
+ break found;
1777
+ }
1778
+ if (code2 === 45) {
1779
+ id = 78;
1780
+ end = offset + 1;
1781
+ matched = "-";
1782
+ break found;
1783
+ }
1213
1784
  break;
1214
1785
  }
1215
- case 29: {
1216
- {
1217
- const e = scanKeyword(text, offset, length, KW[22][0], KW[22][1], look0);
1218
- if (e !== -1) {
1219
- id = 33;
1220
- end = e;
1221
- matched = null;
1222
- break found;
1223
- }
1786
+ case 13: {
1787
+ RX[1].lastIndex = offset;
1788
+ m = RX[1].exec(text);
1789
+ if (m !== null && m[0].length > 0) {
1790
+ id = 58;
1791
+ matched = m[0];
1792
+ end = offset + matched.length;
1793
+ break found;
1224
1794
  }
1225
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1226
- let j = offset + 1;
1227
- while (j < length) {
1228
- const c = text.charCodeAt(j);
1229
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1230
- j++;
1231
- }
1232
- id = 62;
1233
- end = j;
1795
+ if (code2 === 46) {
1796
+ id = 87;
1797
+ end = offset + 1;
1798
+ matched = ".";
1799
+ break found;
1800
+ }
1801
+ break;
1802
+ }
1803
+ case 14: {
1804
+ RX[2].lastIndex = offset;
1805
+ if (RX[2].test(text) && RX[2].lastIndex > offset) {
1806
+ id = 2;
1807
+ end = RX[2].lastIndex;
1234
1808
  matched = null;
1235
1809
  break found;
1236
1810
  }
1811
+ if (code2 === 47) {
1812
+ id = 80;
1813
+ end = offset + 1;
1814
+ matched = "/";
1815
+ break found;
1816
+ }
1237
1817
  break;
1238
1818
  }
1239
- case 30: {
1240
- {
1241
- const e = scanKeyword(text, offset, length, KW[23][0], KW[23][1], look0);
1242
- if (e !== -1) {
1243
- id = 12;
1244
- end = e;
1245
- matched = null;
1246
- break found;
1247
- }
1819
+ case 15: {
1820
+ RX[1].lastIndex = offset;
1821
+ m = RX[1].exec(text);
1822
+ if (m !== null && m[0].length > 0) {
1823
+ id = 58;
1824
+ matched = m[0];
1825
+ end = offset + matched.length;
1826
+ break found;
1248
1827
  }
1249
- {
1250
- const e = scanKeyword(text, offset, length, KW[24][0], KW[24][1], look0);
1251
- if (e !== -1) {
1252
- id = 13;
1253
- end = e;
1254
- matched = null;
1255
- break found;
1256
- }
1828
+ break;
1829
+ }
1830
+ case 16: {
1831
+ if (text.startsWith("::", offset)) {
1832
+ id = 66;
1833
+ end = offset + 2;
1834
+ matched = "::";
1835
+ break found;
1257
1836
  }
1258
1837
  {
1259
- const e = scanKeyword(text, offset, length, KW[25][0], KW[25][1], look0);
1838
+ const e = dfa1(text, offset, length);
1260
1839
  if (e !== -1) {
1261
- id = 16;
1840
+ id = dfaId;
1262
1841
  end = e;
1263
1842
  matched = null;
1264
1843
  break found;
1265
1844
  }
1266
1845
  }
1267
- {
1268
- const e = scanKeyword(text, offset, length, KW[26][0], KW[26][1], look0);
1269
- if (e !== -1) {
1270
- id = 18;
1271
- end = e;
1272
- matched = null;
1273
- break found;
1274
- }
1846
+ break;
1847
+ }
1848
+ case 17: {
1849
+ if (code2 === 59) {
1850
+ id = 88;
1851
+ end = offset + 1;
1852
+ matched = ";";
1853
+ break found;
1275
1854
  }
1276
- {
1277
- const e = scanKeyword(text, offset, length, KW[27][0], KW[27][1], look0);
1278
- if (e !== -1) {
1279
- id = 36;
1280
- end = e;
1281
- matched = null;
1282
- break found;
1283
- }
1855
+ break;
1856
+ }
1857
+ case 18: {
1858
+ if (text.startsWith("<>", offset)) {
1859
+ id = 69;
1860
+ end = offset + 2;
1861
+ matched = "<>";
1862
+ break found;
1284
1863
  }
1285
- {
1286
- const e = scanKeyword(text, offset, length, KW[28][0], KW[28][1], look0);
1287
- if (e !== -1) {
1288
- id = 37;
1289
- end = e;
1290
- matched = null;
1291
- break found;
1292
- }
1864
+ if (text.startsWith("<=", offset)) {
1865
+ id = 70;
1866
+ end = offset + 2;
1867
+ matched = "<=";
1868
+ break found;
1293
1869
  }
1294
- {
1295
- const e = scanKeyword(text, offset, length, KW[29][0], KW[29][1], look0);
1296
- if (e !== -1) {
1297
- id = 49;
1298
- end = e;
1299
- matched = null;
1300
- break found;
1301
- }
1870
+ if (code2 === 60) {
1871
+ id = 74;
1872
+ end = offset + 1;
1873
+ matched = "<";
1874
+ break found;
1302
1875
  }
1303
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1304
- let j = offset + 1;
1305
- while (j < length) {
1306
- const c = text.charCodeAt(j);
1307
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1308
- j++;
1309
- }
1310
- id = 62;
1311
- end = j;
1312
- matched = null;
1876
+ break;
1877
+ }
1878
+ case 19: {
1879
+ if (text.startsWith("==", offset)) {
1880
+ id = 73;
1881
+ end = offset + 2;
1882
+ matched = "==";
1883
+ break found;
1884
+ }
1885
+ if (code2 === 61) {
1886
+ id = 76;
1887
+ end = offset + 1;
1888
+ matched = "=";
1889
+ break found;
1890
+ }
1891
+ break;
1892
+ }
1893
+ case 20: {
1894
+ if (text.startsWith(">=", offset)) {
1895
+ id = 71;
1896
+ end = offset + 2;
1897
+ matched = ">=";
1313
1898
  break found;
1314
1899
  }
1315
- break;
1316
- }
1317
- case 31: {
1318
- {
1319
- const e = scanKeyword(text, offset, length, KW[30][0], KW[30][1], look0);
1320
- if (e !== -1) {
1321
- id = 24;
1322
- end = e;
1323
- matched = null;
1324
- break found;
1325
- }
1326
- }
1327
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1328
- let j = offset + 1;
1329
- while (j < length) {
1330
- const c = text.charCodeAt(j);
1331
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1332
- j++;
1333
- }
1334
- id = 62;
1335
- end = j;
1336
- matched = null;
1900
+ if (code2 === 62) {
1901
+ id = 75;
1902
+ end = offset + 1;
1903
+ matched = ">";
1337
1904
  break found;
1338
1905
  }
1339
1906
  break;
1340
1907
  }
1341
- case 32: {
1342
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1343
- let j = offset + 1;
1344
- while (j < length) {
1345
- const c = text.charCodeAt(j);
1346
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1347
- j++;
1348
- }
1349
- id = 62;
1350
- end = j;
1351
- matched = null;
1908
+ case 21: {
1909
+ if (code2 === 63) {
1910
+ id = 89;
1911
+ end = offset + 1;
1912
+ matched = "?";
1352
1913
  break found;
1353
1914
  }
1354
1915
  break;
1355
1916
  }
1356
- case 33: {
1357
- {
1358
- const e = scanKeyword(text, offset, length, KW[31][0], KW[31][1], look0);
1359
- if (e !== -1) {
1360
- id = 15;
1361
- end = e;
1362
- matched = null;
1363
- break found;
1364
- }
1365
- }
1366
- {
1367
- const e = scanKeyword(text, offset, length, KW[32][0], KW[32][1], look0);
1368
- if (e !== -1) {
1369
- id = 19;
1370
- end = e;
1371
- matched = null;
1372
- break found;
1373
- }
1374
- }
1917
+ case 22: {
1375
1918
  {
1376
- const e = scanKeyword(text, offset, length, KW[33][0], KW[33][1], look0);
1919
+ const e = word0(text, offset, length);
1377
1920
  if (e !== -1) {
1378
- id = 34;
1921
+ id = wordId;
1379
1922
  end = e;
1380
1923
  matched = null;
1381
1924
  break found;
1382
1925
  }
1383
1926
  }
1384
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1385
- let j = offset + 1;
1386
- while (j < length) {
1387
- const c = text.charCodeAt(j);
1388
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1389
- j++;
1390
- }
1391
- id = 62;
1392
- end = j;
1393
- matched = null;
1394
- break found;
1395
- }
1396
1927
  break;
1397
1928
  }
1398
- case 34: {
1929
+ case 23: {
1399
1930
  {
1400
- const e = scanKeyword(text, offset, length, KW[34][0], KW[34][1], look0);
1931
+ const e = word1(text, offset, length);
1401
1932
  if (e !== -1) {
1402
- id = 11;
1933
+ id = wordId;
1403
1934
  end = e;
1404
1935
  matched = null;
1405
1936
  break found;
1406
1937
  }
1407
1938
  }
1939
+ break;
1940
+ }
1941
+ case 24: {
1408
1942
  {
1409
- const e = scanKeyword(text, offset, length, KW[35][0], KW[35][1], look0);
1943
+ const e = word2(text, offset, length);
1410
1944
  if (e !== -1) {
1411
- id = 14;
1945
+ id = wordId;
1412
1946
  end = e;
1413
1947
  matched = null;
1414
1948
  break found;
1415
1949
  }
1416
1950
  }
1951
+ break;
1952
+ }
1953
+ case 25: {
1417
1954
  {
1418
- const e = scanKeyword(text, offset, length, KW[36][0], KW[36][1], look0);
1955
+ const e = word3(text, offset, length);
1419
1956
  if (e !== -1) {
1420
- id = 32;
1957
+ id = wordId;
1421
1958
  end = e;
1422
1959
  matched = null;
1423
1960
  break found;
1424
1961
  }
1425
1962
  }
1426
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1427
- let j = offset + 1;
1428
- while (j < length) {
1429
- const c = text.charCodeAt(j);
1430
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1431
- j++;
1432
- }
1433
- id = 62;
1434
- end = j;
1435
- matched = null;
1436
- break found;
1437
- }
1438
1963
  break;
1439
1964
  }
1440
- case 35: {
1965
+ case 26: {
1441
1966
  {
1442
- const e = scanKeyword(text, offset, length, KW[37][0], KW[37][1], look0);
1967
+ const e = word4(text, offset, length);
1443
1968
  if (e !== -1) {
1444
- id = 10;
1969
+ id = wordId;
1445
1970
  end = e;
1446
1971
  matched = null;
1447
1972
  break found;
1448
1973
  }
1449
1974
  }
1975
+ break;
1976
+ }
1977
+ case 27: {
1450
1978
  {
1451
- const e = scanKeyword(text, offset, length, KW[38][0], KW[38][1], look0);
1979
+ const e = word5(text, offset, length);
1452
1980
  if (e !== -1) {
1453
- id = 22;
1981
+ id = wordId;
1454
1982
  end = e;
1455
1983
  matched = null;
1456
1984
  break found;
1457
1985
  }
1458
1986
  }
1987
+ break;
1988
+ }
1989
+ case 28: {
1459
1990
  {
1460
- const e = scanKeyword(text, offset, length, KW[39][0], KW[39][1], look0);
1991
+ const e = word6(text, offset, length);
1461
1992
  if (e !== -1) {
1462
- id = 25;
1993
+ id = wordId;
1463
1994
  end = e;
1464
1995
  matched = null;
1465
1996
  break found;
1466
1997
  }
1467
1998
  }
1999
+ break;
2000
+ }
2001
+ case 29: {
1468
2002
  {
1469
- const e = scanKeyword(text, offset, length, KW[40][0], KW[40][1], look0);
2003
+ const e = word7(text, offset, length);
1470
2004
  if (e !== -1) {
1471
- id = 29;
2005
+ id = wordId;
1472
2006
  end = e;
1473
2007
  matched = null;
1474
2008
  break found;
1475
2009
  }
1476
2010
  }
2011
+ break;
2012
+ }
2013
+ case 30: {
1477
2014
  {
1478
- const e = scanKeyword(text, offset, length, KW[41][0], KW[41][1], look0);
2015
+ const e = word8(text, offset, length);
1479
2016
  if (e !== -1) {
1480
- id = 35;
2017
+ id = wordId;
1481
2018
  end = e;
1482
2019
  matched = null;
1483
2020
  break found;
1484
2021
  }
1485
2022
  }
2023
+ break;
2024
+ }
2025
+ case 31: {
1486
2026
  {
1487
- const e = scanKeyword(text, offset, length, KW[42][0], KW[42][1], look0);
2027
+ const e = word9(text, offset, length);
1488
2028
  if (e !== -1) {
1489
- id = 53;
2029
+ id = wordId;
1490
2030
  end = e;
1491
2031
  matched = null;
1492
2032
  break found;
1493
2033
  }
1494
2034
  }
2035
+ break;
2036
+ }
2037
+ case 32: {
1495
2038
  if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1496
2039
  let j = offset + 1;
1497
2040
  while (j < length) {
@@ -1506,103 +2049,70 @@ var lexer = (() => {
1506
2049
  }
1507
2050
  break;
1508
2051
  }
1509
- case 36: {
2052
+ case 33: {
1510
2053
  {
1511
- const e = scanKeyword(text, offset, length, KW[43][0], KW[43][1], look0);
2054
+ const e = word10(text, offset, length);
1512
2055
  if (e !== -1) {
1513
- id = 54;
2056
+ id = wordId;
1514
2057
  end = e;
1515
2058
  matched = null;
1516
2059
  break found;
1517
2060
  }
1518
2061
  }
1519
- RX[5].lastIndex = offset;
1520
- m = RX[5].exec(text);
1521
- if (m !== null && m[0].length > 0) {
1522
- id = 57;
1523
- matched = m[0];
1524
- end = offset + matched.length;
1525
- break found;
1526
- }
1527
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1528
- let j = offset + 1;
1529
- while (j < length) {
1530
- const c = text.charCodeAt(j);
1531
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1532
- j++;
1533
- }
1534
- id = 62;
1535
- end = j;
1536
- matched = null;
1537
- break found;
1538
- }
1539
2062
  break;
1540
2063
  }
1541
- case 37: {
2064
+ case 34: {
1542
2065
  {
1543
- const e = scanKeyword(text, offset, length, KW[44][0], KW[44][1], look0);
2066
+ const e = word11(text, offset, length);
1544
2067
  if (e !== -1) {
1545
- id = 20;
2068
+ id = wordId;
1546
2069
  end = e;
1547
2070
  matched = null;
1548
2071
  break found;
1549
2072
  }
1550
2073
  }
1551
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1552
- let j = offset + 1;
1553
- while (j < length) {
1554
- const c = text.charCodeAt(j);
1555
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1556
- j++;
1557
- }
1558
- id = 62;
1559
- end = j;
1560
- matched = null;
1561
- break found;
1562
- }
1563
2074
  break;
1564
2075
  }
1565
- case 38: {
2076
+ case 35: {
1566
2077
  {
1567
- const e = scanKeyword(text, offset, length, KW[45][0], KW[45][1], look0);
2078
+ const e = word12(text, offset, length);
1568
2079
  if (e !== -1) {
1569
- id = 3;
2080
+ id = wordId;
1570
2081
  end = e;
1571
2082
  matched = null;
1572
2083
  break found;
1573
2084
  }
1574
2085
  }
1575
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1576
- let j = offset + 1;
1577
- while (j < length) {
1578
- const c = text.charCodeAt(j);
1579
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1580
- j++;
1581
- }
1582
- id = 62;
1583
- end = j;
1584
- matched = null;
1585
- break found;
1586
- }
1587
2086
  break;
1588
2087
  }
1589
- case 39: {
2088
+ case 36: {
1590
2089
  {
1591
- const e = scanKeyword(text, offset, length, KW[46][0], KW[46][1], look0);
2090
+ const e = scanKeyword(text, offset, length, KW[0][0], KW[0][1], look0);
1592
2091
  if (e !== -1) {
1593
- id = 39;
2092
+ id = 54;
1594
2093
  end = e;
1595
2094
  matched = null;
1596
2095
  break found;
1597
2096
  }
1598
2097
  }
1599
2098
  {
1600
- const e = scanKeyword(text, offset, length, KW[47][0], KW[47][1], look0);
1601
- if (e !== -1) {
1602
- id = 43;
1603
- end = e;
1604
- matched = null;
1605
- break found;
2099
+ let maybe3 = -1;
2100
+ if (!off3) {
2101
+ maybe3 = dfa3(text, offset, length);
2102
+ if (++calls3 === 64 && passes3 * 10 > 448) off3 = true;
2103
+ if (maybe3 !== 0 && calls3 <= 64) passes3++;
2104
+ }
2105
+ if (maybe3 !== 0) {
2106
+ if ((maybe3 & 1) !== 0) {
2107
+ RX[3].lastIndex = offset;
2108
+ m = RX[3].exec(text);
2109
+ if (m !== null && m[0].length > 0) {
2110
+ id = 57;
2111
+ matched = m[0];
2112
+ end = offset + matched.length;
2113
+ break found;
2114
+ }
2115
+ }
1606
2116
  }
1607
2117
  }
1608
2118
  if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
@@ -1619,103 +2129,76 @@ var lexer = (() => {
1619
2129
  }
1620
2130
  break;
1621
2131
  }
1622
- case 40: {
2132
+ case 37: {
1623
2133
  {
1624
- const e = scanKeyword(text, offset, length, KW[48][0], KW[48][1], look0);
2134
+ const e = word13(text, offset, length);
1625
2135
  if (e !== -1) {
1626
- id = 26;
2136
+ id = wordId;
1627
2137
  end = e;
1628
2138
  matched = null;
1629
2139
  break found;
1630
2140
  }
1631
2141
  }
2142
+ break;
2143
+ }
2144
+ case 38: {
1632
2145
  {
1633
- const e = scanKeyword(text, offset, length, KW[49][0], KW[49][1], look0);
2146
+ const e = word14(text, offset, length);
1634
2147
  if (e !== -1) {
1635
- id = 47;
2148
+ id = wordId;
1636
2149
  end = e;
1637
2150
  matched = null;
1638
2151
  break found;
1639
2152
  }
1640
2153
  }
1641
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1642
- let j = offset + 1;
1643
- while (j < length) {
1644
- const c = text.charCodeAt(j);
1645
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1646
- j++;
1647
- }
1648
- id = 62;
1649
- end = j;
1650
- matched = null;
1651
- break found;
1652
- }
1653
2154
  break;
1654
2155
  }
1655
- case 41: {
2156
+ case 39: {
1656
2157
  {
1657
- const e = scanKeyword(text, offset, length, KW[50][0], KW[50][1], look0);
2158
+ const e = word15(text, offset, length);
1658
2159
  if (e !== -1) {
1659
- id = 38;
2160
+ id = wordId;
1660
2161
  end = e;
1661
2162
  matched = null;
1662
2163
  break found;
1663
2164
  }
1664
2165
  }
1665
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1666
- let j = offset + 1;
1667
- while (j < length) {
1668
- const c = text.charCodeAt(j);
1669
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1670
- j++;
1671
- }
1672
- id = 62;
1673
- end = j;
1674
- matched = null;
1675
- break found;
1676
- }
1677
2166
  break;
1678
2167
  }
1679
- case 42: {
2168
+ case 40: {
1680
2169
  {
1681
- const e = scanKeyword(text, offset, length, KW[51][0], KW[51][1], look0);
2170
+ const e = word16(text, offset, length);
1682
2171
  if (e !== -1) {
1683
- id = 5;
2172
+ id = wordId;
1684
2173
  end = e;
1685
2174
  matched = null;
1686
2175
  break found;
1687
2176
  }
1688
2177
  }
2178
+ break;
2179
+ }
2180
+ case 41: {
1689
2181
  {
1690
- const e = scanKeyword(text, offset, length, KW[52][0], KW[52][1], look0);
2182
+ const e = word17(text, offset, length);
1691
2183
  if (e !== -1) {
1692
- id = 42;
2184
+ id = wordId;
1693
2185
  end = e;
1694
2186
  matched = null;
1695
2187
  break found;
1696
2188
  }
1697
2189
  }
2190
+ break;
2191
+ }
2192
+ case 42: {
1698
2193
  {
1699
- const e = scanKeyword(text, offset, length, KW[53][0], KW[53][1], look0);
2194
+ const e = word18(text, offset, length);
1700
2195
  if (e !== -1) {
1701
- id = 46;
2196
+ id = wordId;
1702
2197
  end = e;
1703
2198
  matched = null;
1704
2199
  break found;
1705
2200
  }
1706
2201
  }
1707
- if (code2 >= 65 && code2 <= 90 || code2 === 95 || code2 >= 97 && code2 <= 122) {
1708
- let j = offset + 1;
1709
- while (j < length) {
1710
- const c = text.charCodeAt(j);
1711
- if (!(c === 36 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c === 95 || c >= 97 && c <= 122)) break;
1712
- j++;
1713
- }
1714
- id = 62;
1715
- end = j;
1716
- matched = null;
1717
- break found;
1718
- }
1719
2202
  break;
1720
2203
  }
1721
2204
  case 43: {
@@ -1737,13 +2220,14 @@ var lexer = (() => {
1737
2220
  break;
1738
2221
  }
1739
2222
  case 45: {
1740
- RX[6].lastIndex = offset;
1741
- m = RX[6].exec(text);
1742
- if (m !== null && m[0].length > 0) {
1743
- id = 61;
1744
- matched = m[0];
1745
- end = offset + matched.length;
1746
- break found;
2223
+ {
2224
+ const e = dfa2(text, offset, length);
2225
+ if (e !== -1) {
2226
+ id = dfaId;
2227
+ end = e;
2228
+ matched = null;
2229
+ break found;
2230
+ }
1747
2231
  }
1748
2232
  break;
1749
2233
  }
@@ -12669,6 +13153,61 @@ var internal = {
12669
13153
  // One output row from `[name, value, name, value, ...]`. Compiled, it is a single
12670
13154
  // object literal, so a whole select list costs one call per row. Not
12671
13155
  // deterministic: each row needs its own object, never a folded shared one.
13156
+ // A one-table GROUP BY as one function: [alias, where | null, keys, aggregates], each
13157
+ // aggregate { kind, star, arg, filter }. The loop, the group lookup and the running
13158
+ // totals are one piece of code. Rows come in as `context.$scan`, the group table as
13159
+ // `context.$grp`. COUNT, SUM, AVG, MIN and MAX only: the incremental ones.
13160
+ GROUPSCAN: {
13161
+ method: () => {
13162
+ throw new SqlError("GROUPSCAN runs compiled only");
13163
+ },
13164
+ compile: ([alias, where, keys, aggs], bs) => {
13165
+ const raw = (text) => bs.compile([text]);
13166
+ const simple = (logic) => {
13167
+ const v = logic !== null && typeof logic === "object" ? logic.val : null;
13168
+ return Array.isArray(v) && v.length === 2 && v[0] === alias && typeof v[1] === "string" ? v[1] : null;
13169
+ };
13170
+ const read = (logic) => {
13171
+ const column = simple(logic);
13172
+ return column === null ? logic : raw(`(typeof (p = (r?.[${JSON.stringify(column)}] ?? null)) === "function" ? null : p)`);
13173
+ };
13174
+ const exprs = [...keys, ...aggs.flatMap((a) => [a.arg, a.filter])].filter((e) => e !== null);
13175
+ const needsContext = where !== null || exprs.some((e) => simple(e) === null);
13176
+ let res = raw('(() => { const rows = context["$scan"], grp = context["$grp"], root = grp.root, open = grp.open; let single = null, p, prev; const ints = []; for (let i = 0; i < rows.length; i++) { ');
13177
+ res = bs.compile`${res}if ((i & 1023) === 0) ${sync2(tick)}(Math.min(1024, rows.length - i)); const r = rows[i]; `;
13178
+ if (needsContext) res = bs.compile`${res}context[${alias}] = r; `;
13179
+ if (where !== null) res = bs.compile`${res}if (!${sync2(isTrue)}(${where})) continue; `;
13180
+ const fresh = raw(`{ ${aggs.map((_, j) => `c${j}: 0, s${j}: 0, n${j}: 0, b${j}: null`).join(", ")}${aggs.length ? ", " : ""}first: null }`);
13181
+ if (!keys.length) {
13182
+ res = bs.compile`${res}if (single === null) { single = ${fresh}; open(single, r) } const g = single; `;
13183
+ } else {
13184
+ const key = (logic) => bs.compile`(p = ${read(logic)}) === undefined ? null : (p !== null && typeof p === "object") ? ${sync2(keyOf)}(p) : p`;
13185
+ if (keys.length === 1) {
13186
+ res = bs.compile`${res}let g; { const k = ${key(keys[0])}; if (typeof k === "number" && k >= 0 && k < 1048576 && (k | 0) === k) { g = ints[k]; if (g === undefined) { g = ${fresh}; open(g, r); ints[k] = g } } else { g = root.get(k); if (g === undefined) { g = ${fresh}; open(g, r); root.set(k, g) } } } `;
13187
+ }
13188
+ res = bs.compile`${res}${raw(keys.length === 1 ? "" : "let level = root; ")}`;
13189
+ for (let d = 0; keys.length > 1 && d < keys.length - 1; d++) {
13190
+ res = bs.compile`${res}{ const k = ${key(keys[d])}; let next = level.get(k); if (next === undefined) { next = new Map(); level.set(k, next) } level = next } `;
13191
+ }
13192
+ if (keys.length > 1) res = bs.compile`${res}let g; { const k = ${key(keys[keys.length - 1])}; g = level.get(k); if (g === undefined) { g = ${fresh}; open(g, r); level.set(k, g) } } `;
13193
+ }
13194
+ aggs.forEach((a, j) => {
13195
+ let body;
13196
+ if (a.star) body = raw(`g.c${j}++; `);
13197
+ else {
13198
+ const kindCode = a.kind === SUM || a.kind === AVG ? bs.compile`${raw('const x = typeof v === "number" ? v : ')}${sync2(toNumber)}(v); if (x !== null) ${raw(`{ g.s${j} += x; g.n${j}++ }`)} ` : a.kind === MIN || a.kind === MAX ? bs.compile`${raw(`if (g.b${j} === null || (typeof v === "number" && typeof g.b${j} === "number" ? v ${a.kind === MIN ? "<" : ">"} g.b${j} : `)}${sync2(sortCompare)}(v, ${raw(`g.b${j}`)}, false, null) ${raw(a.kind === MIN ? "< 0" : "> 0")})) ${raw(`g.b${j} = v; `)}` : raw("");
13199
+ body = bs.compile`${raw("const v = ")}${read(a.arg)}; if (v !== null && v !== undefined) { ${raw(`g.c${j}++; `)}${kindCode} } `;
13200
+ }
13201
+ if (a.filter !== null) body = bs.compile`if (${sync2(isTrue)}(${read(a.filter)})) { ${body} } `;
13202
+ res = bs.compile`${res}{ ${body} } `;
13203
+ });
13204
+ return bs.compile`${res}} })()`;
13205
+ },
13206
+ traverse: false,
13207
+ deterministic: false
13208
+ },
13209
+ // (Both scans declare their own `prev`, the engine's scratch variable, so the snippets inside
13210
+ // them use a local instead of the enclosing function's, which a closure would keep in memory.)
12672
13211
  // A whole single-table scan as one function: [alias, where | null, row]. Compiled, the
12673
13212
  // loop, the filter and the projection are one piece of code, with the rows passed in
12674
13213
  // as `context.$scan`. Only used compiled; the interpreted path runs the loop itself.
@@ -12678,7 +13217,7 @@ var internal = {
12678
13217
  },
12679
13218
  compile: ([alias, where, row], bs) => {
12680
13219
  const skip = where === null ? bs.compile`` : bs.compile`if (!${sync2(isTrue)}(${where})) continue;`;
12681
- return bs.compile`(() => { const rows = context["$scan"]; const out = []; for (let i = 0; i < rows.length; i++) { if ((i & 1023) === 0) ${sync2(tick)}(Math.min(1024, rows.length - i)); context[${alias}] = rows[i]; ${skip} out.push(${row}) } return out })()`;
13220
+ return bs.compile`(() => { let prev; const rows = context["$scan"]; const out = []; for (let i = 0; i < rows.length; i++) { if ((i & 1023) === 0) ${sync2(tick)}(Math.min(1024, rows.length - i)); context[${alias}] = rows[i]; ${skip} out.push(${row}) } return out })()`;
12682
13221
  },
12683
13222
  traverse: false,
12684
13223
  deterministic: false
@@ -13033,8 +13572,9 @@ function extend(env, aliases, alias, row) {
13033
13572
  }
13034
13573
  function runSelect(p, state, outer, keep = null) {
13035
13574
  const base = outer ? Object.create(outer) : {};
13036
- const projector = makeProjector(p, state);
13037
13575
  const orderFns = p.orderBy ? p.orderBy.map((o) => fnOf(state, o.expr)) : null;
13576
+ const scan = orderFns === null && !p.grouped && p.having === null && scannable(p, state);
13577
+ const projector = makeProjector(p, state, scan);
13038
13578
  const top = orderFns && keep !== null && !p.distinct ? topK(keep, comparatorFor(p.orderBy)) : null;
13039
13579
  let items;
13040
13580
  let plain = null;
@@ -13051,8 +13591,8 @@ function runSelect(p, state, outer, keep = null) {
13051
13591
  });
13052
13592
  items = top.best;
13053
13593
  } else if (orderFns === null) {
13054
- plain = scanRows(p, state, base);
13055
- if (plain === null) {
13594
+ if (scan) plain = scanRows(p, state, base);
13595
+ else {
13056
13596
  plain = [];
13057
13597
  streamRows(p, state, base, (env) => {
13058
13598
  plain.push(projector.project(env));
@@ -13072,7 +13612,7 @@ function runSelect(p, state, outer, keep = null) {
13072
13612
  } else {
13073
13613
  let envs;
13074
13614
  if (single && p.grouped) {
13075
- envs = group(p, state, base, (visit) => streamRows(p, state, base, visit));
13615
+ envs = groupScannable(p, state) ? groupScan(p, state, base) : group(p, state, base, (visit) => streamRows(p, state, base, visit));
13076
13616
  } else {
13077
13617
  envs = [base];
13078
13618
  for (const step2 of p.steps) envs = joinStep(step2, envs, base, state);
@@ -13137,9 +13677,47 @@ function sourceRows(p, state, base) {
13137
13677
  const source = p.steps[0].source;
13138
13678
  return source.kind === "expr" ? toRows(fnOf(state, source.expr)(base), false) : materialize(source, state);
13139
13679
  }
13680
+ var groupLogics = /* @__PURE__ */ new WeakMap();
13681
+ function groupScannable(p, state) {
13682
+ return !state.interpreted && p.aggregates.every((spec) => INCREMENTAL.has(spec.name) && !spec.distinct && !spec.orderBy);
13683
+ }
13684
+ function groupScan(p, state, base) {
13685
+ let logic = groupLogics.get(p);
13686
+ if (!logic) {
13687
+ const aggs2 = p.aggregates.map((spec) => ({
13688
+ kind: KIND[spec.name],
13689
+ star: spec.star,
13690
+ arg: spec.star ? null : spec.args[0],
13691
+ filter: spec.filter
13692
+ }));
13693
+ groupLogics.set(p, logic = { GROUPSCAN: [p.steps[0].alias, p.where, p.groupBy ?? [], aggs2] });
13694
+ }
13695
+ const alias = p.steps[0].alias;
13696
+ const aggs = p.aggregates.map((spec) => ({ incremental: true, kind: KIND[spec.name] }));
13697
+ const list = [];
13698
+ const open = (g, row) => {
13699
+ g.first = snapshot(base);
13700
+ g.first[alias] = row;
13701
+ list.push(g);
13702
+ rows(list.length);
13703
+ };
13704
+ const env = snapshot(base);
13705
+ env.$scan = sourceRows(p, state, base);
13706
+ env.$grp = { root: /* @__PURE__ */ new Map(), open };
13707
+ fnOf(state, logic)(env);
13708
+ if (!(p.groupBy && p.groupBy.length) && list.length === 0) list.push({ first: base, accs: newAccumulators(aggs) });
13709
+ for (let i = 0; i < list.length; i++) {
13710
+ const g = list[i];
13711
+ if (g.accs) continue;
13712
+ g.accs = aggs.map((_, j) => ({ count: g[`c${j}`], sum: g[`s${j}`], numeric: g[`n${j}`], best: g[`b${j}`] }));
13713
+ }
13714
+ return finishGroups(list, aggs);
13715
+ }
13140
13716
  var scanLogics = /* @__PURE__ */ new WeakMap();
13717
+ function scannable(p, state) {
13718
+ return !state.interpreted && p.row !== null && p.steps.length === 1 && p.steps[0].join === "FROM" && !p.windows.length;
13719
+ }
13141
13720
  function scanRows(p, state, base) {
13142
- if (state.interpreted || !p.row) return null;
13143
13721
  let logic = scanLogics.get(p);
13144
13722
  if (!logic) scanLogics.set(p, logic = { SCAN: [p.steps[0].alias, p.where, p.row] });
13145
13723
  const env = snapshot(base);
@@ -13166,10 +13744,11 @@ function orderKeys(p, env, row, projector, orderFns) {
13166
13744
  for (let k = 0; k < orderFns.length; k++) keys[k] = orderFns[k](env);
13167
13745
  return keys;
13168
13746
  }
13169
- function makeProjector(p, state) {
13747
+ function makeProjector(p, state, skipBuild = false) {
13170
13748
  const cols = p.columns;
13171
- const exprFns = cols.map((c) => c.kind === "expr" ? fnOf(state, c.expr) : null);
13172
13749
  const hasStar = cols.some((c) => c.kind === "star");
13750
+ const rowFn = !skipBuild && !hasStar && p.row ? fnOf(state, p.row) : null;
13751
+ const exprFns = skipBuild || rowFn ? [] : cols.map((c) => c.kind === "expr" ? fnOf(state, c.expr) : null);
13173
13752
  const columnSet = /* @__PURE__ */ new Set();
13174
13753
  const columns = [];
13175
13754
  const addColumn = (name) => {
@@ -13180,7 +13759,6 @@ function makeProjector(p, state) {
13180
13759
  };
13181
13760
  if (!hasStar) for (const c of cols) addColumn(c.name);
13182
13761
  const plain = cols.map((c) => c.kind === "expr" && c.name !== "__proto__");
13183
- const rowFn = !hasStar && p.row ? fnOf(state, p.row) : null;
13184
13762
  const project = rowFn ?? ((env) => {
13185
13763
  const out = {};
13186
13764
  for (let j = 0; j < cols.length; j++) {
@@ -13797,6 +14375,9 @@ function group(p, state, base, each) {
13797
14375
  for (let i = 0; i < aggs.length; i++) accumulate(aggs[i], g.accs[i], env);
13798
14376
  });
13799
14377
  }
14378
+ return finishGroups(list, aggs);
14379
+ }
14380
+ function finishGroups(list, aggs) {
13800
14381
  const out = new Array(list.length);
13801
14382
  for (let gi = 0; gi < list.length; gi++) {
13802
14383
  const g = list[gi];
@@ -14045,10 +14626,31 @@ function prepare(sql, options = {}) {
14045
14626
  };
14046
14627
  }
14047
14628
  function query(sql, data, options = {}) {
14048
- return prepare(sql, options).query(data, options.params);
14629
+ const engine2 = options.engine ?? defaultEngine;
14630
+ return asRows(last(executePlan(planFor(sql, engine2, options), data, { ...options, engine: engine2 }).results));
14049
14631
  }
14050
14632
  function execute(sql, data, options = {}) {
14051
- return prepare(sql, options).execute(data, options.params);
14633
+ const engine2 = options.engine ?? defaultEngine;
14634
+ return executePlan(planFor(sql, engine2, options), data, { ...options, engine: engine2 });
14635
+ }
14636
+ var plans = /* @__PURE__ */ new WeakMap();
14637
+ var PLAN_CACHE_SIZE = 256;
14638
+ var PLAN_CACHE_MAX_SQL = 8192;
14639
+ function planFor(sql, engine2, options) {
14640
+ const fresh = () => compile(sql, { functions: engine2.sqlFunctions, limits: options.limits });
14641
+ if (options.limits || typeof sql !== "string" || sql.length > PLAN_CACHE_MAX_SQL) return fresh();
14642
+ let cache = plans.get(engine2);
14643
+ if (!cache) plans.set(engine2, cache = /* @__PURE__ */ new Map());
14644
+ let plan = cache.get(sql);
14645
+ if (plan !== void 0) {
14646
+ cache.delete(sql);
14647
+ cache.set(sql, plan);
14648
+ return plan;
14649
+ }
14650
+ plan = fresh();
14651
+ cache.set(sql, plan);
14652
+ if (cache.size > PLAN_CACHE_SIZE) cache.delete(cache.keys().next().value);
14653
+ return plan;
14052
14654
  }
14053
14655
  function last(results) {
14054
14656
  for (let i = results.length - 1; i >= 0; i--) if (!("inserted" in results[i])) return results[i];