grammar-well 1.1.2 → 1.1.3

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.
Files changed (61) hide show
  1. package/build/compiler/compiler.d.ts +49 -49
  2. package/build/compiler/compiler.js +227 -227
  3. package/build/compiler/generator.d.ts +23 -23
  4. package/build/compiler/generator.js +213 -212
  5. package/build/compiler/generator.js.map +1 -1
  6. package/build/compiler/import-resolver.d.ts +15 -15
  7. package/build/compiler/import-resolver.js +36 -36
  8. package/build/compiler/outputs/javascript.d.ts +3 -3
  9. package/build/compiler/outputs/javascript.js +14 -14
  10. package/build/compiler/outputs/json.d.ts +2 -2
  11. package/build/compiler/outputs/json.js +7 -7
  12. package/build/compiler/outputs/typescript.d.ts +2 -2
  13. package/build/compiler/outputs/typescript.js +9 -8
  14. package/build/compiler/outputs/typescript.js.map +1 -1
  15. package/build/grammars/gwell.d.ts +1023 -997
  16. package/build/grammars/gwell.js +540 -536
  17. package/build/grammars/gwell.js.map +1 -1
  18. package/build/grammars/json.d.ts +151 -151
  19. package/build/grammars/json.js +111 -111
  20. package/build/grammars/number.d.ts +239 -239
  21. package/build/grammars/number.js +114 -114
  22. package/build/grammars/number.json +1 -1
  23. package/build/grammars/string.d.ts +116 -116
  24. package/build/grammars/string.js +49 -49
  25. package/build/grammars/string.json +1 -1
  26. package/build/grammars/whitespace.d.ts +51 -51
  27. package/build/grammars/whitespace.js +29 -29
  28. package/build/grammars/whitespace.json +1 -1
  29. package/build/index.d.ts +4 -4
  30. package/build/index.js +20 -20
  31. package/build/lexers/character-lexer.d.ts +27 -27
  32. package/build/lexers/character-lexer.js +70 -70
  33. package/build/lexers/stateful-lexer.d.ts +48 -48
  34. package/build/lexers/stateful-lexer.js +308 -308
  35. package/build/lexers/token-buffer.d.ts +32 -32
  36. package/build/lexers/token-buffer.js +91 -91
  37. package/build/parser/algorithms/cyk.d.ts +16 -16
  38. package/build/parser/algorithms/cyk.js +57 -57
  39. package/build/parser/algorithms/earley.d.ts +48 -48
  40. package/build/parser/algorithms/earley.js +157 -157
  41. package/build/parser/algorithms/lr.d.ts +10 -10
  42. package/build/parser/algorithms/lr.js +33 -33
  43. package/build/parser/parser.d.ts +26 -26
  44. package/build/parser/parser.js +73 -73
  45. package/build/typings.d.ts +199 -198
  46. package/build/typings.js +2 -2
  47. package/build/utility/general.d.ts +55 -55
  48. package/build/utility/general.js +165 -165
  49. package/build/utility/lint.d.ts +2 -2
  50. package/build/utility/lint.js +27 -27
  51. package/build/utility/lr.d.ts +52 -52
  52. package/build/utility/lr.js +129 -129
  53. package/build/utility/text-format.d.ts +11 -11
  54. package/build/utility/text-format.js +83 -83
  55. package/package.json +1 -1
  56. package/src/compiler/generator.ts +1 -0
  57. package/src/compiler/outputs/typescript.ts +2 -1
  58. package/src/grammars/gwell.gwell +15 -13
  59. package/src/grammars/gwell.js +17 -13
  60. package/src/grammars/gwell.json +1 -1
  61. package/src/typings.ts +1 -0
@@ -1,115 +1,115 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function GWLanguage() {
4
- return {
5
- grammar: {
6
- start: "unsigned_int",
7
- rules: {
8
- unsigned_int$RPT1Nx1: [
9
- { name: "unsigned_int$RPT1Nx1", symbols: [/[0-9]/] },
10
- { name: "unsigned_int$RPT1Nx1", symbols: ["unsigned_int$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
11
- ],
12
- unsigned_int: [
13
- { name: "unsigned_int", symbols: ["unsigned_int$RPT1Nx1"], postprocess: ({ data }) => { return parseInt(data[0].join("")); } }
14
- ],
15
- int$RPT01x1$SUBx1: [
16
- { name: "int$RPT01x1$SUBx1", symbols: [{ literal: "-" }] },
17
- { name: "int$RPT01x1$SUBx1", symbols: [{ literal: "+" }] }
18
- ],
19
- int$RPT01x1: [
20
- { name: "int$RPT01x1", symbols: ["int$RPT01x1$SUBx1"], postprocess: ({ data }) => data[0] },
21
- { name: "int$RPT01x1", symbols: [], postprocess: () => null }
22
- ],
23
- int$RPT1Nx1: [
24
- { name: "int$RPT1Nx1", symbols: [/[0-9]/] },
25
- { name: "int$RPT1Nx1", symbols: ["int$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
26
- ],
27
- int: [
28
- { name: "int", symbols: ["int$RPT01x1", "int$RPT1Nx1"], postprocess: ({ data }) => { return data[0] ? parseInt(data[0][0] + data[1].join("")) : parseInt(data[1].join("")); } }
29
- ],
30
- unsigned_decimal$RPT1Nx1: [
31
- { name: "unsigned_decimal$RPT1Nx1", symbols: [/[0-9]/] },
32
- { name: "unsigned_decimal$RPT1Nx1", symbols: ["unsigned_decimal$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
33
- ],
34
- unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1: [
35
- { name: "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
36
- { name: "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", symbols: ["unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
37
- ],
38
- unsigned_decimal$RPT01x1$SUBx1: [
39
- { name: "unsigned_decimal$RPT01x1$SUBx1", symbols: [{ literal: "." }, "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1"] }
40
- ],
41
- unsigned_decimal$RPT01x1: [
42
- { name: "unsigned_decimal$RPT01x1", symbols: ["unsigned_decimal$RPT01x1$SUBx1"], postprocess: ({ data }) => data[0] },
43
- { name: "unsigned_decimal$RPT01x1", symbols: [], postprocess: () => null }
44
- ],
45
- unsigned_decimal: [
46
- { name: "unsigned_decimal", symbols: ["unsigned_decimal$RPT1Nx1", "unsigned_decimal$RPT01x1"], postprocess: ({ data }) => { return parseFloat(data[0].join("") + (data[1] ? "." + data[1][1].join("") : "")); } }
47
- ],
48
- decimal$RPT01x1: [
49
- { name: "decimal$RPT01x1", symbols: [{ literal: "-" }], postprocess: ({ data }) => data[0] },
50
- { name: "decimal$RPT01x1", symbols: [], postprocess: () => null }
51
- ],
52
- decimal$RPT1Nx1: [
53
- { name: "decimal$RPT1Nx1", symbols: [/[0-9]/] },
54
- { name: "decimal$RPT1Nx1", symbols: ["decimal$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
55
- ],
56
- decimal$RPT01x2$SUBx1$RPT1Nx1: [
57
- { name: "decimal$RPT01x2$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
58
- { name: "decimal$RPT01x2$SUBx1$RPT1Nx1", symbols: ["decimal$RPT01x2$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
59
- ],
60
- decimal$RPT01x2$SUBx1: [
61
- { name: "decimal$RPT01x2$SUBx1", symbols: [{ literal: "." }, "decimal$RPT01x2$SUBx1$RPT1Nx1"] }
62
- ],
63
- decimal$RPT01x2: [
64
- { name: "decimal$RPT01x2", symbols: ["decimal$RPT01x2$SUBx1"], postprocess: ({ data }) => data[0] },
65
- { name: "decimal$RPT01x2", symbols: [], postprocess: () => null }
66
- ],
67
- decimal: [
68
- { name: "decimal", symbols: ["decimal$RPT01x1", "decimal$RPT1Nx1", "decimal$RPT01x2"], postprocess: ({ data }) => { return parseFloat((data[0] || "") + data[1].join("") + (data[2] ? "." + data[2][1].join("") : "")); } }
69
- ],
70
- percentage: [
71
- { name: "percentage", symbols: ["decimal", { literal: "%" }], postprocess: ({ data }) => { return data[0] / 100; } }
72
- ],
73
- jsonfloat$RPT01x1: [
74
- { name: "jsonfloat$RPT01x1", symbols: [{ literal: "-" }], postprocess: ({ data }) => data[0] },
75
- { name: "jsonfloat$RPT01x1", symbols: [], postprocess: () => null }
76
- ],
77
- jsonfloat$RPT1Nx1: [
78
- { name: "jsonfloat$RPT1Nx1", symbols: [/[0-9]/] },
79
- { name: "jsonfloat$RPT1Nx1", symbols: ["jsonfloat$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
80
- ],
81
- jsonfloat$RPT01x2$SUBx1$RPT1Nx1: [
82
- { name: "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
83
- { name: "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", symbols: ["jsonfloat$RPT01x2$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
84
- ],
85
- jsonfloat$RPT01x2$SUBx1: [
86
- { name: "jsonfloat$RPT01x2$SUBx1", symbols: [{ literal: "." }, "jsonfloat$RPT01x2$SUBx1$RPT1Nx1"] }
87
- ],
88
- jsonfloat$RPT01x2: [
89
- { name: "jsonfloat$RPT01x2", symbols: ["jsonfloat$RPT01x2$SUBx1"], postprocess: ({ data }) => data[0] },
90
- { name: "jsonfloat$RPT01x2", symbols: [], postprocess: () => null }
91
- ],
92
- jsonfloat$RPT01x3$SUBx1$RPT01x1: [
93
- { name: "jsonfloat$RPT01x3$SUBx1$RPT01x1", symbols: [/[+-]/], postprocess: ({ data }) => data[0] },
94
- { name: "jsonfloat$RPT01x3$SUBx1$RPT01x1", symbols: [], postprocess: () => null }
95
- ],
96
- jsonfloat$RPT01x3$SUBx1$RPT1Nx1: [
97
- { name: "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
98
- { name: "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", symbols: ["jsonfloat$RPT01x3$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
99
- ],
100
- jsonfloat$RPT01x3$SUBx1: [
101
- { name: "jsonfloat$RPT01x3$SUBx1", symbols: [/[eE]/, "jsonfloat$RPT01x3$SUBx1$RPT01x1", "jsonfloat$RPT01x3$SUBx1$RPT1Nx1"] }
102
- ],
103
- jsonfloat$RPT01x3: [
104
- { name: "jsonfloat$RPT01x3", symbols: ["jsonfloat$RPT01x3$SUBx1"], postprocess: ({ data }) => data[0] },
105
- { name: "jsonfloat$RPT01x3", symbols: [], postprocess: () => null }
106
- ],
107
- jsonfloat: [
108
- { name: "jsonfloat", symbols: ["jsonfloat$RPT01x1", "jsonfloat$RPT1Nx1", "jsonfloat$RPT01x2", "jsonfloat$RPT01x3"], postprocess: ({ data }) => { return parseFloat((data[0] || "") + data[1].join("") + (data[2] ? "." + data[2][1].join("") : "") + (data[3] ? "e" + (data[3][1] || "+") + data[3][2].join("") : "")); } }
109
- ]
110
- }
111
- }
112
- };
113
- }
114
- exports.default = GWLanguage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function GWLanguage() {
4
+ return {
5
+ grammar: {
6
+ start: "unsigned_int",
7
+ rules: {
8
+ unsigned_int$RPT1Nx1: [
9
+ { name: "unsigned_int$RPT1Nx1", symbols: [/[0-9]/] },
10
+ { name: "unsigned_int$RPT1Nx1", symbols: ["unsigned_int$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
11
+ ],
12
+ unsigned_int: [
13
+ { name: "unsigned_int", symbols: ["unsigned_int$RPT1Nx1"], postprocess: ({ data }) => { return parseInt(data[0].join("")); } }
14
+ ],
15
+ int$RPT01x1$SUBx1: [
16
+ { name: "int$RPT01x1$SUBx1", symbols: [{ literal: "-" }] },
17
+ { name: "int$RPT01x1$SUBx1", symbols: [{ literal: "+" }] }
18
+ ],
19
+ int$RPT01x1: [
20
+ { name: "int$RPT01x1", symbols: ["int$RPT01x1$SUBx1"], postprocess: ({ data }) => data[0] },
21
+ { name: "int$RPT01x1", symbols: [], postprocess: () => null }
22
+ ],
23
+ int$RPT1Nx1: [
24
+ { name: "int$RPT1Nx1", symbols: [/[0-9]/] },
25
+ { name: "int$RPT1Nx1", symbols: ["int$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
26
+ ],
27
+ int: [
28
+ { name: "int", symbols: ["int$RPT01x1", "int$RPT1Nx1"], postprocess: ({ data }) => { return data[0] ? parseInt(data[0][0] + data[1].join("")) : parseInt(data[1].join("")); } }
29
+ ],
30
+ unsigned_decimal$RPT1Nx1: [
31
+ { name: "unsigned_decimal$RPT1Nx1", symbols: [/[0-9]/] },
32
+ { name: "unsigned_decimal$RPT1Nx1", symbols: ["unsigned_decimal$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
33
+ ],
34
+ unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1: [
35
+ { name: "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
36
+ { name: "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", symbols: ["unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
37
+ ],
38
+ unsigned_decimal$RPT01x1$SUBx1: [
39
+ { name: "unsigned_decimal$RPT01x1$SUBx1", symbols: [{ literal: "." }, "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1"] }
40
+ ],
41
+ unsigned_decimal$RPT01x1: [
42
+ { name: "unsigned_decimal$RPT01x1", symbols: ["unsigned_decimal$RPT01x1$SUBx1"], postprocess: ({ data }) => data[0] },
43
+ { name: "unsigned_decimal$RPT01x1", symbols: [], postprocess: () => null }
44
+ ],
45
+ unsigned_decimal: [
46
+ { name: "unsigned_decimal", symbols: ["unsigned_decimal$RPT1Nx1", "unsigned_decimal$RPT01x1"], postprocess: ({ data }) => { return parseFloat(data[0].join("") + (data[1] ? "." + data[1][1].join("") : "")); } }
47
+ ],
48
+ decimal$RPT01x1: [
49
+ { name: "decimal$RPT01x1", symbols: [{ literal: "-" }], postprocess: ({ data }) => data[0] },
50
+ { name: "decimal$RPT01x1", symbols: [], postprocess: () => null }
51
+ ],
52
+ decimal$RPT1Nx1: [
53
+ { name: "decimal$RPT1Nx1", symbols: [/[0-9]/] },
54
+ { name: "decimal$RPT1Nx1", symbols: ["decimal$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
55
+ ],
56
+ decimal$RPT01x2$SUBx1$RPT1Nx1: [
57
+ { name: "decimal$RPT01x2$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
58
+ { name: "decimal$RPT01x2$SUBx1$RPT1Nx1", symbols: ["decimal$RPT01x2$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
59
+ ],
60
+ decimal$RPT01x2$SUBx1: [
61
+ { name: "decimal$RPT01x2$SUBx1", symbols: [{ literal: "." }, "decimal$RPT01x2$SUBx1$RPT1Nx1"] }
62
+ ],
63
+ decimal$RPT01x2: [
64
+ { name: "decimal$RPT01x2", symbols: ["decimal$RPT01x2$SUBx1"], postprocess: ({ data }) => data[0] },
65
+ { name: "decimal$RPT01x2", symbols: [], postprocess: () => null }
66
+ ],
67
+ decimal: [
68
+ { name: "decimal", symbols: ["decimal$RPT01x1", "decimal$RPT1Nx1", "decimal$RPT01x2"], postprocess: ({ data }) => { return parseFloat((data[0] || "") + data[1].join("") + (data[2] ? "." + data[2][1].join("") : "")); } }
69
+ ],
70
+ percentage: [
71
+ { name: "percentage", symbols: ["decimal", { literal: "%" }], postprocess: ({ data }) => { return data[0] / 100; } }
72
+ ],
73
+ jsonfloat$RPT01x1: [
74
+ { name: "jsonfloat$RPT01x1", symbols: [{ literal: "-" }], postprocess: ({ data }) => data[0] },
75
+ { name: "jsonfloat$RPT01x1", symbols: [], postprocess: () => null }
76
+ ],
77
+ jsonfloat$RPT1Nx1: [
78
+ { name: "jsonfloat$RPT1Nx1", symbols: [/[0-9]/] },
79
+ { name: "jsonfloat$RPT1Nx1", symbols: ["jsonfloat$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
80
+ ],
81
+ jsonfloat$RPT01x2$SUBx1$RPT1Nx1: [
82
+ { name: "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
83
+ { name: "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", symbols: ["jsonfloat$RPT01x2$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
84
+ ],
85
+ jsonfloat$RPT01x2$SUBx1: [
86
+ { name: "jsonfloat$RPT01x2$SUBx1", symbols: [{ literal: "." }, "jsonfloat$RPT01x2$SUBx1$RPT1Nx1"] }
87
+ ],
88
+ jsonfloat$RPT01x2: [
89
+ { name: "jsonfloat$RPT01x2", symbols: ["jsonfloat$RPT01x2$SUBx1"], postprocess: ({ data }) => data[0] },
90
+ { name: "jsonfloat$RPT01x2", symbols: [], postprocess: () => null }
91
+ ],
92
+ jsonfloat$RPT01x3$SUBx1$RPT01x1: [
93
+ { name: "jsonfloat$RPT01x3$SUBx1$RPT01x1", symbols: [/[+-]/], postprocess: ({ data }) => data[0] },
94
+ { name: "jsonfloat$RPT01x3$SUBx1$RPT01x1", symbols: [], postprocess: () => null }
95
+ ],
96
+ jsonfloat$RPT01x3$SUBx1$RPT1Nx1: [
97
+ { name: "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", symbols: [/[0-9]/] },
98
+ { name: "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", symbols: ["jsonfloat$RPT01x3$SUBx1$RPT1Nx1", /[0-9]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
99
+ ],
100
+ jsonfloat$RPT01x3$SUBx1: [
101
+ { name: "jsonfloat$RPT01x3$SUBx1", symbols: [/[eE]/, "jsonfloat$RPT01x3$SUBx1$RPT01x1", "jsonfloat$RPT01x3$SUBx1$RPT1Nx1"] }
102
+ ],
103
+ jsonfloat$RPT01x3: [
104
+ { name: "jsonfloat$RPT01x3", symbols: ["jsonfloat$RPT01x3$SUBx1"], postprocess: ({ data }) => data[0] },
105
+ { name: "jsonfloat$RPT01x3", symbols: [], postprocess: () => null }
106
+ ],
107
+ jsonfloat: [
108
+ { name: "jsonfloat", symbols: ["jsonfloat$RPT01x1", "jsonfloat$RPT1Nx1", "jsonfloat$RPT01x2", "jsonfloat$RPT01x3"], postprocess: ({ data }) => { return parseFloat((data[0] || "") + data[1].join("") + (data[2] ? "." + data[2][1].join("") : "") + (data[3] ? "e" + (data[3][1] || "+") + data[3][2].join("") : "")); } }
109
+ ]
110
+ }
111
+ }
112
+ };
113
+ }
114
+ exports.default = GWLanguage;
115
115
  //# sourceMappingURL=number.js.map
@@ -1 +1 @@
1
- { "state": { "grammar": { "start": "unsigned_int", "rules": { "unsigned_int$RPT1Nx1": [{ "name": "unsigned_int$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "unsigned_int$RPT1Nx1", "symbols": [{ "rule": "unsigned_int$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "unsigned_int": [{ "name": "unsigned_int", "symbols": [{ "rule": "unsigned_int$RPT1Nx1" }], "postprocess": { "template": "parseInt($0.join(\"\"))" } }], "int$RPT01x1$SUBx1": [{ "name": "int$RPT01x1$SUBx1", "symbols": [{ "literal": "-", "insensitive": false }] }, { "name": "int$RPT01x1$SUBx1", "symbols": [{ "literal": "+", "insensitive": false }] }], "int$RPT01x1": [{ "name": "int$RPT01x1", "symbols": [{ "rule": "int$RPT01x1$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "int$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "int$RPT1Nx1": [{ "name": "int$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "int$RPT1Nx1", "symbols": [{ "rule": "int$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "int": [{ "name": "int", "symbols": [{ "rule": "int$RPT01x1" }, { "rule": "int$RPT1Nx1" }], "postprocess": { "template": "$0 ? parseInt($0[0]+$1.join(\"\")) : parseInt($1.join(\"\"))" } }], "unsigned_decimal$RPT1Nx1": [{ "name": "unsigned_decimal$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "unsigned_decimal$RPT1Nx1", "symbols": [{ "rule": "unsigned_decimal$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1": [{ "name": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", "symbols": [{ "rule": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "unsigned_decimal$RPT01x1$SUBx1": [{ "name": "unsigned_decimal$RPT01x1$SUBx1", "symbols": [{ "literal": ".", "insensitive": false }, { "rule": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1" }] }], "unsigned_decimal$RPT01x1": [{ "name": "unsigned_decimal$RPT01x1", "symbols": [{ "rule": "unsigned_decimal$RPT01x1$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "unsigned_decimal$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "unsigned_decimal": [{ "name": "unsigned_decimal", "symbols": [{ "rule": "unsigned_decimal$RPT1Nx1" }, { "rule": "unsigned_decimal$RPT01x1" }], "postprocess": { "template": "parseFloat($0.join(\"\") + ($1 ? \".\"+$1[1].join(\"\") : \"\"))" } }], "decimal$RPT01x1": [{ "name": "decimal$RPT01x1", "symbols": [{ "literal": "-", "insensitive": false }], "postprocess": { "builtin": "first" } }, { "name": "decimal$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "decimal$RPT1Nx1": [{ "name": "decimal$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "decimal$RPT1Nx1", "symbols": [{ "rule": "decimal$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "decimal$RPT01x2$SUBx1$RPT1Nx1": [{ "name": "decimal$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "decimal$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "rule": "decimal$RPT01x2$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "decimal$RPT01x2$SUBx1": [{ "name": "decimal$RPT01x2$SUBx1", "symbols": [{ "literal": ".", "insensitive": false }, { "rule": "decimal$RPT01x2$SUBx1$RPT1Nx1" }] }], "decimal$RPT01x2": [{ "name": "decimal$RPT01x2", "symbols": [{ "rule": "decimal$RPT01x2$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "decimal$RPT01x2", "symbols": [], "postprocess": { "builtin": "null" } }], "decimal": [{ "name": "decimal", "symbols": [{ "rule": "decimal$RPT01x1" }, { "rule": "decimal$RPT1Nx1" }, { "rule": "decimal$RPT01x2" }], "postprocess": { "template": "parseFloat( ($0 || \"\") + $1.join(\"\") +($2 ? \".\"+$2[1].join(\"\") : \"\"))" } }], "percentage": [{ "name": "percentage", "symbols": [{ "rule": "decimal" }, { "literal": "%", "insensitive": false }], "postprocess": { "template": "$0/100" } }], "jsonfloat$RPT01x1": [{ "name": "jsonfloat$RPT01x1", "symbols": [{ "literal": "-", "insensitive": false }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat$RPT1Nx1": [{ "name": "jsonfloat$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "jsonfloat$RPT1Nx1", "symbols": [{ "rule": "jsonfloat$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "jsonfloat$RPT01x2$SUBx1$RPT1Nx1": [{ "name": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "rule": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "jsonfloat$RPT01x2$SUBx1": [{ "name": "jsonfloat$RPT01x2$SUBx1", "symbols": [{ "literal": ".", "insensitive": false }, { "rule": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1" }] }], "jsonfloat$RPT01x2": [{ "name": "jsonfloat$RPT01x2", "symbols": [{ "rule": "jsonfloat$RPT01x2$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x2", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat$RPT01x3$SUBx1$RPT01x1": [{ "name": "jsonfloat$RPT01x3$SUBx1$RPT01x1", "symbols": [{ "regex": "[+-]", "flags": "" }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x3$SUBx1$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat$RPT01x3$SUBx1$RPT1Nx1": [{ "name": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", "symbols": [{ "rule": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "jsonfloat$RPT01x3$SUBx1": [{ "name": "jsonfloat$RPT01x3$SUBx1", "symbols": [{ "regex": "[eE]", "flags": "" }, { "rule": "jsonfloat$RPT01x3$SUBx1$RPT01x1" }, { "rule": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1" }] }], "jsonfloat$RPT01x3": [{ "name": "jsonfloat$RPT01x3", "symbols": [{ "rule": "jsonfloat$RPT01x3$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x3", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat": [{ "name": "jsonfloat", "symbols": [{ "rule": "jsonfloat$RPT01x1" }, { "rule": "jsonfloat$RPT1Nx1" }, { "rule": "jsonfloat$RPT01x2" }, { "rule": "jsonfloat$RPT01x3" }], "postprocess": { "template": "parseFloat( ($0 || \"\") + $1.join(\"\") + ($2 ? \".\"+$2[1].join(\"\") : \"\") + ($3 ? \"e\" + ($3[1] || \"+\") + $3[2].join(\"\") : \"\"))" } }] }, "uuids": { "unsigned_int$RPT1N": 1, "int$RPT01": 1, "int$RPT01x1$SUB": 1, "int$RPT1N": 1, "unsigned_decimal$RPT1N": 1, "unsigned_decimal$RPT01": 1, "unsigned_decimal$RPT01x1$SUB": 1, "unsigned_decimal$RPT01x1$SUBx1$RPT1N": 1, "decimal$RPT01": 2, "decimal$RPT1N": 1, "decimal$RPT01x2$SUB": 1, "decimal$RPT01x2$SUBx1$RPT1N": 1, "jsonfloat$RPT01": 3, "jsonfloat$RPT1N": 1, "jsonfloat$RPT01x2$SUB": 1, "jsonfloat$RPT01x2$SUBx1$RPT1N": 1, "jsonfloat$RPT01x3$SUB": 1, "jsonfloat$RPT01x3$SUBx1$RPT01": 1, "jsonfloat$RPT01x3$SUBx1$RPT1N": 1 } }, "lexer": null, "head": [], "body": [], "config": {}, "version": "unknown" }, "exportName": "GWLanguage" }
1
+ { "state": { "grammar": { "start": "unsigned_int", "rules": { "unsigned_int$RPT1Nx1": [{ "name": "unsigned_int$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "unsigned_int$RPT1Nx1", "symbols": [{ "rule": "unsigned_int$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "unsigned_int": [{ "name": "unsigned_int", "symbols": [{ "rule": "unsigned_int$RPT1Nx1" }], "postprocess": { "template": "parseInt($0.join(\"\"))" } }], "int$RPT01x1$SUBx1": [{ "name": "int$RPT01x1$SUBx1", "symbols": [{ "literal": "-", "insensitive": false }] }, { "name": "int$RPT01x1$SUBx1", "symbols": [{ "literal": "+", "insensitive": false }] }], "int$RPT01x1": [{ "name": "int$RPT01x1", "symbols": [{ "rule": "int$RPT01x1$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "int$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "int$RPT1Nx1": [{ "name": "int$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "int$RPT1Nx1", "symbols": [{ "rule": "int$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "int": [{ "name": "int", "symbols": [{ "rule": "int$RPT01x1" }, { "rule": "int$RPT1Nx1" }], "postprocess": { "template": "$0 ? parseInt($0[0]+$1.join(\"\")) : parseInt($1.join(\"\"))" } }], "unsigned_decimal$RPT1Nx1": [{ "name": "unsigned_decimal$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "unsigned_decimal$RPT1Nx1", "symbols": [{ "rule": "unsigned_decimal$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1": [{ "name": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1", "symbols": [{ "rule": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "unsigned_decimal$RPT01x1$SUBx1": [{ "name": "unsigned_decimal$RPT01x1$SUBx1", "symbols": [{ "literal": ".", "insensitive": false }, { "rule": "unsigned_decimal$RPT01x1$SUBx1$RPT1Nx1" }] }], "unsigned_decimal$RPT01x1": [{ "name": "unsigned_decimal$RPT01x1", "symbols": [{ "rule": "unsigned_decimal$RPT01x1$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "unsigned_decimal$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "unsigned_decimal": [{ "name": "unsigned_decimal", "symbols": [{ "rule": "unsigned_decimal$RPT1Nx1" }, { "rule": "unsigned_decimal$RPT01x1" }], "postprocess": { "template": "parseFloat($0.join(\"\") + ($1 ? \".\"+$1[1].join(\"\") : \"\"))" } }], "decimal$RPT01x1": [{ "name": "decimal$RPT01x1", "symbols": [{ "literal": "-", "insensitive": false }], "postprocess": { "builtin": "first" } }, { "name": "decimal$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "decimal$RPT1Nx1": [{ "name": "decimal$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "decimal$RPT1Nx1", "symbols": [{ "rule": "decimal$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "decimal$RPT01x2$SUBx1$RPT1Nx1": [{ "name": "decimal$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "decimal$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "rule": "decimal$RPT01x2$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "decimal$RPT01x2$SUBx1": [{ "name": "decimal$RPT01x2$SUBx1", "symbols": [{ "literal": ".", "insensitive": false }, { "rule": "decimal$RPT01x2$SUBx1$RPT1Nx1" }] }], "decimal$RPT01x2": [{ "name": "decimal$RPT01x2", "symbols": [{ "rule": "decimal$RPT01x2$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "decimal$RPT01x2", "symbols": [], "postprocess": { "builtin": "null" } }], "decimal": [{ "name": "decimal", "symbols": [{ "rule": "decimal$RPT01x1" }, { "rule": "decimal$RPT1Nx1" }, { "rule": "decimal$RPT01x2" }], "postprocess": { "template": "parseFloat( ($0 || \"\") + $1.join(\"\") +($2 ? \".\"+$2[1].join(\"\") : \"\"))" } }], "percentage": [{ "name": "percentage", "symbols": [{ "rule": "decimal" }, { "literal": "%", "insensitive": false }], "postprocess": { "template": "$0/100" } }], "jsonfloat$RPT01x1": [{ "name": "jsonfloat$RPT01x1", "symbols": [{ "literal": "-", "insensitive": false }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat$RPT1Nx1": [{ "name": "jsonfloat$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "jsonfloat$RPT1Nx1", "symbols": [{ "rule": "jsonfloat$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "jsonfloat$RPT01x2$SUBx1$RPT1Nx1": [{ "name": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1", "symbols": [{ "rule": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "jsonfloat$RPT01x2$SUBx1": [{ "name": "jsonfloat$RPT01x2$SUBx1", "symbols": [{ "literal": ".", "insensitive": false }, { "rule": "jsonfloat$RPT01x2$SUBx1$RPT1Nx1" }] }], "jsonfloat$RPT01x2": [{ "name": "jsonfloat$RPT01x2", "symbols": [{ "rule": "jsonfloat$RPT01x2$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x2", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat$RPT01x3$SUBx1$RPT01x1": [{ "name": "jsonfloat$RPT01x3$SUBx1$RPT01x1", "symbols": [{ "regex": "[+-]", "flags": "" }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x3$SUBx1$RPT01x1", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat$RPT01x3$SUBx1$RPT1Nx1": [{ "name": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", "symbols": [{ "regex": "[0-9]", "flags": "" }] }, { "name": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1", "symbols": [{ "rule": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1" }, { "regex": "[0-9]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "jsonfloat$RPT01x3$SUBx1": [{ "name": "jsonfloat$RPT01x3$SUBx1", "symbols": [{ "regex": "[eE]", "flags": "" }, { "rule": "jsonfloat$RPT01x3$SUBx1$RPT01x1" }, { "rule": "jsonfloat$RPT01x3$SUBx1$RPT1Nx1" }] }], "jsonfloat$RPT01x3": [{ "name": "jsonfloat$RPT01x3", "symbols": [{ "rule": "jsonfloat$RPT01x3$SUBx1" }], "postprocess": { "builtin": "first" } }, { "name": "jsonfloat$RPT01x3", "symbols": [], "postprocess": { "builtin": "null" } }], "jsonfloat": [{ "name": "jsonfloat", "symbols": [{ "rule": "jsonfloat$RPT01x1" }, { "rule": "jsonfloat$RPT1Nx1" }, { "rule": "jsonfloat$RPT01x2" }, { "rule": "jsonfloat$RPT01x3" }], "postprocess": { "template": "parseFloat( ($0 || \"\") + $1.join(\"\") + ($2 ? \".\"+$2[1].join(\"\") : \"\") + ($3 ? \"e\" + ($3[1] || \"+\") + $3[2].join(\"\") : \"\"))" } }] }, "uuids": { "unsigned_int$RPT1N": 1, "int$RPT01": 1, "int$RPT01x1$SUB": 1, "int$RPT1N": 1, "unsigned_decimal$RPT1N": 1, "unsigned_decimal$RPT01": 1, "unsigned_decimal$RPT01x1$SUB": 1, "unsigned_decimal$RPT01x1$SUBx1$RPT1N": 1, "decimal$RPT01": 2, "decimal$RPT1N": 1, "decimal$RPT01x2$SUB": 1, "decimal$RPT01x2$SUBx1$RPT1N": 1, "jsonfloat$RPT01": 3, "jsonfloat$RPT1N": 1, "jsonfloat$RPT01x2$SUB": 1, "jsonfloat$RPT01x2$SUBx1$RPT1N": 1, "jsonfloat$RPT01x3$SUB": 1, "jsonfloat$RPT01x3$SUBx1$RPT01": 1, "jsonfloat$RPT01x3$SUBx1$RPT1N": 1 } }, "lexer": null, "head": [], "body": [], "config": {}, "version": "unknown" }, "exportName": "GWLanguage" }
@@ -1,116 +1,116 @@
1
- export default GWLanguage;
2
- declare function GWLanguage(): {
3
- grammar: {
4
- start: string;
5
- rules: {
6
- dqstring$RPT0Nx1: ({
7
- name: string;
8
- symbols: any[];
9
- postprocess?: undefined;
10
- } | {
11
- name: string;
12
- symbols: string[];
13
- postprocess: ({ data }: {
14
- data: any;
15
- }) => any;
16
- })[];
17
- dqstring: {
18
- name: string;
19
- symbols: (string | {
20
- literal: string;
21
- })[];
22
- postprocess: ({ data }: {
23
- data: any;
24
- }) => any;
25
- }[];
26
- sqstring$RPT0Nx1: ({
27
- name: string;
28
- symbols: any[];
29
- postprocess?: undefined;
30
- } | {
31
- name: string;
32
- symbols: string[];
33
- postprocess: ({ data }: {
34
- data: any;
35
- }) => any;
36
- })[];
37
- sqstring: {
38
- name: string;
39
- symbols: (string | {
40
- literal: string;
41
- })[];
42
- postprocess: ({ data }: {
43
- data: any;
44
- }) => any;
45
- }[];
46
- btstring$RPT0Nx1: ({
47
- name: string;
48
- symbols: any[];
49
- postprocess?: undefined;
50
- } | {
51
- name: string;
52
- symbols: (string | RegExp)[];
53
- postprocess: ({ data }: {
54
- data: any;
55
- }) => any;
56
- })[];
57
- btstring: {
58
- name: string;
59
- symbols: (string | {
60
- literal: string;
61
- })[];
62
- postprocess: ({ data }: {
63
- data: any;
64
- }) => any;
65
- }[];
66
- dstrchar: ({
67
- name: string;
68
- symbols: RegExp[];
69
- postprocess: ({ data }: {
70
- data: any;
71
- }) => any;
72
- } | {
73
- name: string;
74
- symbols: (string | {
75
- literal: string;
76
- })[];
77
- postprocess: ({ data }: {
78
- data: any;
79
- }) => any;
80
- })[];
81
- sstrchar: ({
82
- name: string;
83
- symbols: RegExp[];
84
- postprocess: ({ data }: {
85
- data: any;
86
- }) => any;
87
- } | {
88
- name: string;
89
- symbols: (string | {
90
- literal: string;
91
- })[];
92
- postprocess: ({ data }: {
93
- data: any;
94
- }) => any;
95
- })[];
96
- sstrchar$STRx1: {
97
- name: string;
98
- symbols: {
99
- literal: string;
100
- }[];
101
- postprocess: ({ data }: {
102
- data: any;
103
- }) => any;
104
- }[];
105
- strescape: {
106
- name: string;
107
- symbols: (RegExp | {
108
- literal: string;
109
- })[];
110
- postprocess: ({ data }: {
111
- data: any;
112
- }) => any;
113
- }[];
114
- };
115
- };
116
- };
1
+ export default GWLanguage;
2
+ declare function GWLanguage(): {
3
+ grammar: {
4
+ start: string;
5
+ rules: {
6
+ dqstring$RPT0Nx1: ({
7
+ name: string;
8
+ symbols: any[];
9
+ postprocess?: undefined;
10
+ } | {
11
+ name: string;
12
+ symbols: string[];
13
+ postprocess: ({ data }: {
14
+ data: any;
15
+ }) => any;
16
+ })[];
17
+ dqstring: {
18
+ name: string;
19
+ symbols: (string | {
20
+ literal: string;
21
+ })[];
22
+ postprocess: ({ data }: {
23
+ data: any;
24
+ }) => any;
25
+ }[];
26
+ sqstring$RPT0Nx1: ({
27
+ name: string;
28
+ symbols: any[];
29
+ postprocess?: undefined;
30
+ } | {
31
+ name: string;
32
+ symbols: string[];
33
+ postprocess: ({ data }: {
34
+ data: any;
35
+ }) => any;
36
+ })[];
37
+ sqstring: {
38
+ name: string;
39
+ symbols: (string | {
40
+ literal: string;
41
+ })[];
42
+ postprocess: ({ data }: {
43
+ data: any;
44
+ }) => any;
45
+ }[];
46
+ btstring$RPT0Nx1: ({
47
+ name: string;
48
+ symbols: any[];
49
+ postprocess?: undefined;
50
+ } | {
51
+ name: string;
52
+ symbols: (string | RegExp)[];
53
+ postprocess: ({ data }: {
54
+ data: any;
55
+ }) => any;
56
+ })[];
57
+ btstring: {
58
+ name: string;
59
+ symbols: (string | {
60
+ literal: string;
61
+ })[];
62
+ postprocess: ({ data }: {
63
+ data: any;
64
+ }) => any;
65
+ }[];
66
+ dstrchar: ({
67
+ name: string;
68
+ symbols: RegExp[];
69
+ postprocess: ({ data }: {
70
+ data: any;
71
+ }) => any;
72
+ } | {
73
+ name: string;
74
+ symbols: (string | {
75
+ literal: string;
76
+ })[];
77
+ postprocess: ({ data }: {
78
+ data: any;
79
+ }) => any;
80
+ })[];
81
+ sstrchar: ({
82
+ name: string;
83
+ symbols: RegExp[];
84
+ postprocess: ({ data }: {
85
+ data: any;
86
+ }) => any;
87
+ } | {
88
+ name: string;
89
+ symbols: (string | {
90
+ literal: string;
91
+ })[];
92
+ postprocess: ({ data }: {
93
+ data: any;
94
+ }) => any;
95
+ })[];
96
+ sstrchar$STRx1: {
97
+ name: string;
98
+ symbols: {
99
+ literal: string;
100
+ }[];
101
+ postprocess: ({ data }: {
102
+ data: any;
103
+ }) => any;
104
+ }[];
105
+ strescape: {
106
+ name: string;
107
+ symbols: (RegExp | {
108
+ literal: string;
109
+ })[];
110
+ postprocess: ({ data }: {
111
+ data: any;
112
+ }) => any;
113
+ }[];
114
+ };
115
+ };
116
+ };
@@ -1,50 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function GWLanguage() {
4
- return {
5
- grammar: {
6
- start: "dqstring",
7
- rules: {
8
- dqstring$RPT0Nx1: [
9
- { name: "dqstring$RPT0Nx1", symbols: [] },
10
- { name: "dqstring$RPT0Nx1", symbols: ["dqstring$RPT0Nx1", "dstrchar"], postprocess: ({ data }) => data[0].concat([data[1]]) }
11
- ],
12
- dqstring: [
13
- { name: "dqstring", symbols: [{ literal: "\"" }, "dqstring$RPT0Nx1", { literal: "\"" }], postprocess: ({ data }) => { return data[1].join(""); } }
14
- ],
15
- sqstring$RPT0Nx1: [
16
- { name: "sqstring$RPT0Nx1", symbols: [] },
17
- { name: "sqstring$RPT0Nx1", symbols: ["sqstring$RPT0Nx1", "sstrchar"], postprocess: ({ data }) => data[0].concat([data[1]]) }
18
- ],
19
- sqstring: [
20
- { name: "sqstring", symbols: [{ literal: "'" }, "sqstring$RPT0Nx1", { literal: "'" }], postprocess: ({ data }) => { return data[1].join(""); } }
21
- ],
22
- btstring$RPT0Nx1: [
23
- { name: "btstring$RPT0Nx1", symbols: [] },
24
- { name: "btstring$RPT0Nx1", symbols: ["btstring$RPT0Nx1", /[^`]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
25
- ],
26
- btstring: [
27
- { name: "btstring", symbols: [{ literal: "`" }, "btstring$RPT0Nx1", { literal: "`" }], postprocess: ({ data }) => { return data[1].join(""); } }
28
- ],
29
- dstrchar: [
30
- { name: "dstrchar", symbols: [/[^\\"\n]/], postprocess: ({ data }) => { return data[0]; } },
31
- { name: "dstrchar", symbols: [{ literal: "\\" }, "strescape"], postprocess: ({ data }) => { return JSON.parse("\"" + data.join("") + "\""); } }
32
- ],
33
- sstrchar: [
34
- { name: "sstrchar", symbols: [/[^\\'\n]/], postprocess: ({ data }) => { return data[0]; } },
35
- { name: "sstrchar", symbols: [{ literal: "\\" }, "strescape"], postprocess: ({ data }) => { return JSON.parse("\"" + data.join("") + "\""); } },
36
- { name: "sstrchar", symbols: ["sstrchar$STRx1"], postprocess: ({ data }) => { return "'"; } }
37
- ],
38
- sstrchar$STRx1: [
39
- { name: "sstrchar$STRx1", symbols: [{ literal: "\\" }, { literal: "'" }], postprocess: ({ data }) => data.join('') }
40
- ],
41
- strescape: [
42
- { name: "strescape", symbols: [/["\/bfnrt]/], postprocess: ({ data }) => { return data[0]; } },
43
- { name: "strescape", symbols: [{ literal: "u" }, /[a-fA-F0-9]/, /[a-fA-F0-9]/, /[a-fA-F0-9]/, /[a-fA-F0-9]/], postprocess: ({ data }) => { return data.join(""); } }
44
- ]
45
- }
46
- }
47
- };
48
- }
49
- exports.default = GWLanguage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function GWLanguage() {
4
+ return {
5
+ grammar: {
6
+ start: "dqstring",
7
+ rules: {
8
+ dqstring$RPT0Nx1: [
9
+ { name: "dqstring$RPT0Nx1", symbols: [] },
10
+ { name: "dqstring$RPT0Nx1", symbols: ["dqstring$RPT0Nx1", "dstrchar"], postprocess: ({ data }) => data[0].concat([data[1]]) }
11
+ ],
12
+ dqstring: [
13
+ { name: "dqstring", symbols: [{ literal: "\"" }, "dqstring$RPT0Nx1", { literal: "\"" }], postprocess: ({ data }) => { return data[1].join(""); } }
14
+ ],
15
+ sqstring$RPT0Nx1: [
16
+ { name: "sqstring$RPT0Nx1", symbols: [] },
17
+ { name: "sqstring$RPT0Nx1", symbols: ["sqstring$RPT0Nx1", "sstrchar"], postprocess: ({ data }) => data[0].concat([data[1]]) }
18
+ ],
19
+ sqstring: [
20
+ { name: "sqstring", symbols: [{ literal: "'" }, "sqstring$RPT0Nx1", { literal: "'" }], postprocess: ({ data }) => { return data[1].join(""); } }
21
+ ],
22
+ btstring$RPT0Nx1: [
23
+ { name: "btstring$RPT0Nx1", symbols: [] },
24
+ { name: "btstring$RPT0Nx1", symbols: ["btstring$RPT0Nx1", /[^`]/], postprocess: ({ data }) => data[0].concat([data[1]]) }
25
+ ],
26
+ btstring: [
27
+ { name: "btstring", symbols: [{ literal: "`" }, "btstring$RPT0Nx1", { literal: "`" }], postprocess: ({ data }) => { return data[1].join(""); } }
28
+ ],
29
+ dstrchar: [
30
+ { name: "dstrchar", symbols: [/[^\\"\n]/], postprocess: ({ data }) => { return data[0]; } },
31
+ { name: "dstrchar", symbols: [{ literal: "\\" }, "strescape"], postprocess: ({ data }) => { return JSON.parse("\"" + data.join("") + "\""); } }
32
+ ],
33
+ sstrchar: [
34
+ { name: "sstrchar", symbols: [/[^\\'\n]/], postprocess: ({ data }) => { return data[0]; } },
35
+ { name: "sstrchar", symbols: [{ literal: "\\" }, "strescape"], postprocess: ({ data }) => { return JSON.parse("\"" + data.join("") + "\""); } },
36
+ { name: "sstrchar", symbols: ["sstrchar$STRx1"], postprocess: ({ data }) => { return "'"; } }
37
+ ],
38
+ sstrchar$STRx1: [
39
+ { name: "sstrchar$STRx1", symbols: [{ literal: "\\" }, { literal: "'" }], postprocess: ({ data }) => data.join('') }
40
+ ],
41
+ strescape: [
42
+ { name: "strescape", symbols: [/["\/bfnrt]/], postprocess: ({ data }) => { return data[0]; } },
43
+ { name: "strescape", symbols: [{ literal: "u" }, /[a-fA-F0-9]/, /[a-fA-F0-9]/, /[a-fA-F0-9]/, /[a-fA-F0-9]/], postprocess: ({ data }) => { return data.join(""); } }
44
+ ]
45
+ }
46
+ }
47
+ };
48
+ }
49
+ exports.default = GWLanguage;
50
50
  //# sourceMappingURL=string.js.map