grammar-well 1.2.2 → 1.2.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 (38) hide show
  1. package/bootstrap.ts +6 -3
  2. package/build/compiler/compiler.js +2 -2
  3. package/build/compiler/compiler.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/compiler/compiler.ts +2 -2
  6. package/build/grammars/gwell.d.ts +0 -1039
  7. package/build/grammars/gwell.js +0 -553
  8. package/build/grammars/gwell.js.map +0 -1
  9. package/build/grammars/json.d.ts +0 -151
  10. package/build/grammars/json.js +0 -112
  11. package/build/grammars/json.js.map +0 -1
  12. package/build/grammars/number.d.ts +0 -239
  13. package/build/grammars/number.js +0 -115
  14. package/build/grammars/number.js.map +0 -1
  15. package/build/grammars/number.json +0 -1
  16. package/build/grammars/string.d.ts +0 -116
  17. package/build/grammars/string.js +0 -50
  18. package/build/grammars/string.js.map +0 -1
  19. package/build/grammars/string.json +0 -1
  20. package/build/grammars/whitespace.d.ts +0 -51
  21. package/build/grammars/whitespace.js +0 -30
  22. package/build/grammars/whitespace.js.map +0 -1
  23. package/build/grammars/whitespace.json +0 -1
  24. package/src/grammars/gwell.gwell +0 -281
  25. package/src/grammars/gwell.js +0 -555
  26. package/src/grammars/gwell.json +0 -1
  27. package/src/grammars/json.gwell +0 -75
  28. package/src/grammars/json.js +0 -121
  29. package/src/grammars/json.json +0 -1
  30. package/src/grammars/number.gwell +0 -20
  31. package/src/grammars/number.js +0 -117
  32. package/src/grammars/number.json +0 -1
  33. package/src/grammars/string.gwell +0 -15
  34. package/src/grammars/string.js +0 -52
  35. package/src/grammars/string.json +0 -1
  36. package/src/grammars/whitespace.gwell +0 -6
  37. package/src/grammars/whitespace.js +0 -32
  38. package/src/grammars/whitespace.json +0 -1
@@ -1 +0,0 @@
1
- { "state": { "grammar": { "start": "unsigned_int", "config": {}, "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 +0,0 @@
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 +0,0 @@
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
- //# sourceMappingURL=string.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/grammars/string.js"],"names":[],"mappings":";;AAGA,SAAS,UAAU;IAEf,OAAO;QACH,OAAO,EAAE;YACL,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE;gBACH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I,EAAC,EAAE,EAAE,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;iBACvK;aACJ;SACJ;KACJ,CAAA;AACL,CAAC;AAED,kBAAe,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- { "state": { "grammar": { "start": "dqstring", "config": {}, "rules": { "dqstring$RPT0Nx1": [{ "name": "dqstring$RPT0Nx1", "symbols": [] }, { "name": "dqstring$RPT0Nx1", "symbols": [{ "rule": "dqstring$RPT0Nx1" }, { "rule": "dstrchar" }], "postprocess": { "builtin": "concat" } }], "dqstring": [{ "name": "dqstring", "symbols": [{ "literal": "\"", "insensitive": false }, { "rule": "dqstring$RPT0Nx1" }, { "literal": "\"", "insensitive": false }], "postprocess": { "template": "$1.join(\"\")" } }], "sqstring$RPT0Nx1": [{ "name": "sqstring$RPT0Nx1", "symbols": [] }, { "name": "sqstring$RPT0Nx1", "symbols": [{ "rule": "sqstring$RPT0Nx1" }, { "rule": "sstrchar" }], "postprocess": { "builtin": "concat" } }], "sqstring": [{ "name": "sqstring", "symbols": [{ "literal": "'", "insensitive": false }, { "rule": "sqstring$RPT0Nx1" }, { "literal": "'", "insensitive": false }], "postprocess": { "template": "$1.join(\"\")" } }], "btstring$RPT0Nx1": [{ "name": "btstring$RPT0Nx1", "symbols": [] }, { "name": "btstring$RPT0Nx1", "symbols": [{ "rule": "btstring$RPT0Nx1" }, { "regex": "[^`]", "flags": "" }], "postprocess": { "builtin": "concat" } }], "btstring": [{ "name": "btstring", "symbols": [{ "literal": "`", "insensitive": false }, { "rule": "btstring$RPT0Nx1" }, { "literal": "`", "insensitive": false }], "postprocess": { "template": "$1.join(\"\")" } }], "dstrchar": [{ "name": "dstrchar", "symbols": [{ "regex": "[^\\\\\"\\n]", "flags": "" }], "postprocess": { "template": "$0" } }, { "name": "dstrchar", "symbols": [{ "literal": "\\", "insensitive": false }, { "rule": "strescape" }], "postprocess": { "template": "JSON.parse(\"\\\"\"+data.join(\"\")+\"\\\"\")" } }], "sstrchar": [{ "name": "sstrchar", "symbols": [{ "regex": "[^\\\\'\\n]", "flags": "" }], "postprocess": { "template": "$0" } }, { "name": "sstrchar", "symbols": [{ "literal": "\\", "insensitive": false }, { "rule": "strescape" }], "postprocess": { "template": "JSON.parse(\"\\\"\"+data.join(\"\")+\"\\\"\")" } }, { "name": "sstrchar", "symbols": [{ "rule": "sstrchar$STRx1" }], "postprocess": { "template": "\"'\"" } }], "sstrchar$STRx1": [{ "name": "sstrchar$STRx1", "symbols": [{ "literal": "\\" }, { "literal": "'" }], "postprocess": { "builtin": "join" } }], "strescape": [{ "name": "strescape", "symbols": [{ "regex": "[\"\\/bfnrt]", "flags": "" }], "postprocess": { "template": "$0" } }, { "name": "strescape", "symbols": [{ "literal": "u", "insensitive": false }, { "regex": "[a-fA-F0-9]", "flags": "" }, { "regex": "[a-fA-F0-9]", "flags": "" }, { "regex": "[a-fA-F0-9]", "flags": "" }, { "regex": "[a-fA-F0-9]", "flags": "" }], "postprocess": { "template": "data.join(\"\")" } }] }, "uuids": { "dqstring$RPT0N": 1, "sqstring$RPT0N": 1, "btstring$RPT0N": 1, "sstrchar$STR": 1 } }, "lexer": null, "head": [], "body": [], "config": {}, "version": "unknown" }, "exportName": "GWLanguage" }
@@ -1,51 +0,0 @@
1
- export default GWLanguage;
2
- declare function GWLanguage(): {
3
- grammar: {
4
- start: string;
5
- rules: {
6
- _$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
- _: {
18
- name: string;
19
- symbols: string[];
20
- postprocess: ({ data }: {
21
- data: any;
22
- }) => any;
23
- }[];
24
- __$RPT1Nx1: ({
25
- name: string;
26
- symbols: string[];
27
- postprocess?: undefined;
28
- } | {
29
- name: string;
30
- symbols: string[];
31
- postprocess: ({ data }: {
32
- data: any;
33
- }) => any;
34
- })[];
35
- __: {
36
- name: string;
37
- symbols: string[];
38
- postprocess: ({ data }: {
39
- data: any;
40
- }) => any;
41
- }[];
42
- wschar: {
43
- name: string;
44
- symbols: RegExp[];
45
- postprocess: ({ data }: {
46
- data: any;
47
- }) => any;
48
- }[];
49
- };
50
- };
51
- };
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function GWLanguage() {
4
- return {
5
- grammar: {
6
- start: "_",
7
- rules: {
8
- _$RPT0Nx1: [
9
- { name: "_$RPT0Nx1", symbols: [] },
10
- { name: "_$RPT0Nx1", symbols: ["_$RPT0Nx1", "wschar"], postprocess: ({ data }) => data[0].concat([data[1]]) }
11
- ],
12
- _: [
13
- { name: "_", symbols: ["_$RPT0Nx1"], postprocess: ({ data }) => { return null; } }
14
- ],
15
- __$RPT1Nx1: [
16
- { name: "__$RPT1Nx1", symbols: ["wschar"] },
17
- { name: "__$RPT1Nx1", symbols: ["__$RPT1Nx1", "wschar"], postprocess: ({ data }) => data[0].concat([data[1]]) }
18
- ],
19
- __: [
20
- { name: "__", symbols: ["__$RPT1Nx1"], postprocess: ({ data }) => { return null; } }
21
- ],
22
- wschar: [
23
- { name: "wschar", symbols: [/[\t\n\v\f]/], postprocess: ({ data }) => { return data[0].value; } }
24
- ]
25
- }
26
- }
27
- };
28
- }
29
- exports.default = GWLanguage;
30
- //# sourceMappingURL=whitespace.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"whitespace.js","sourceRoot":"","sources":["../../src/grammars/whitespace.js"],"names":[],"mappings":";;AAGA,SAAS,UAAU;IAEf,OAAO;QACH,OAAO,EAAE;YACL,KAAK,EAAE,GAAG;YACV,KAAK,EAAE;gBACH,SAAS,EAAE;oBACP,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAG,EAAE;oBACnC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAE,WAAW,EAAE,QAAQ,CAAE,EAAE,WAAW,E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, { "name": "_$RPT0Nx1", "symbols": [{ "rule": "_$RPT0Nx1" }, { "rule": "wschar" }], "postprocess": { "builtin": "concat" } }], "_": [{ "name": "_", "symbols": [{ "rule": "_$RPT0Nx1" }], "postprocess": { "template": "null" } }], "__$RPT1Nx1": [{ "name": "__$RPT1Nx1", "symbols": [{ "rule": "wschar" }] }, { "name": "__$RPT1Nx1", "symbols": [{ "rule": "__$RPT1Nx1" }, { "rule": "wschar" }], "postprocess": { "builtin": "concat" } }], "__": [{ "name": "__", "symbols": [{ "rule": "__$RPT1Nx1" }], "postprocess": { "template": "null" } }], "wschar": [{ "name": "wschar", "symbols": [{ "regex": "[\\t\\n\\v\\f]", "flags": "" }], "postprocess": { "template": "$0.value" } }] }, "uuids": { "_$RPT0N": 1, "__$RPT1N": 1 } }, "lexer": null, "head": [], "body": [], "config": {}, "version": "unknown" }, "exportName": "GWLanguage" }
@@ -1,281 +0,0 @@
1
- lexer: {{
2
- start: "start"
3
-
4
- start ->
5
- - import: string, js, ws, comment, l_scolon, l_star
6
- - when: /lexer(?![a-zA-Z\d_])/ tag: "T_WORD" goto: lexer highlight: "type"
7
- - when: /grammar(?![a-zA-Z\d_])/ tag: "T_WORD" goto: grammar highlight: "type"
8
- - when: /config(?![a-zA-Z\d_])/ tag: "T_WORD" goto: config highlight: "type"
9
- - import: kv
10
- config ->
11
- - import: ws, l_colon
12
- - when: "{{" tag: "L_TEMPLATEL" set: config_inner
13
- config_inner ->
14
- - import: comment, kv
15
- - when: "}}" tag: "L_TEMPLATER" pop: 1
16
- grammar ->
17
- - import: ws, l_colon
18
- - when: "{{" tag: "L_TEMPLATEL" set: grammar_inner
19
- grammar_inner ->
20
- - import: comment, js, js_template, ws, regex, l_qmark, l_plus, l_star, kv, l_colon, l_comma, l_pipe, l_parenl, l_parenr, l_arrow, l_dsign, l_dash
21
- - when: "}}" tag: "L_TEMPLATER" pop: 1
22
- lexer ->
23
- - import: ws, l_colon
24
- - when: "{{" tag: "L_TEMPLATEL" set: lexer_inner
25
- lexer_inner ->
26
- - import: ws, comment, regex, l_comma, l_arrow, l_dash, kv, js
27
- - when: "}}" tag: "L_TEMPLATER" pop: 1
28
- js ->
29
- - when: "${" tag: "L_JSL" goto: js_wrap
30
- js_wrap ->
31
- default: "T_JSBODY"
32
- unmatched: "T_JSBODY"
33
- - import: jsignore
34
- - when: "{" tag: "T_JSBODY" goto: js_literal
35
- - when: "}" tag: "L_JSR" pop: 1
36
- js_literal ->
37
- default: "T_JSBODY"
38
- unmatched: "T_JSBODY"
39
- - import: jsignore
40
- - when: "{" tag: "T_JSBODY" goto: js_literal
41
- - when: "}" tag: "T_JSBODY" pop: 1
42
- js_template ->
43
- - when: "{{" tag: "L_TEMPLATEL" goto: js_template_inner
44
- js_template_inner ->
45
- default: "T_JSBODY"
46
- unmatched: "T_JSBODY"
47
- - import: jsignore
48
- - when: "{" tag: "T_JSBODY" goto: js_literal
49
- - when: "}}" tag: "L_TEMPLATER" pop: 1
50
- kv ->
51
- - import: string, ws, word, l_colon, integer
52
- jsignore ->
53
- - when: /"(?:[^"\\\r\n]|\\.)*"/ tag: "T_JSBODY"
54
- - when: /'(?:[^'\\\r\n]|\\.)*'/ tag: "T_JSBODY"
55
- - when: /`(?:[^`\\]|\\.)*`/ tag: "T_JSBODY"
56
- - when: /\/(?:[^\/\\\r\n]|\\.)+\/[gmiyu]*/ tag: "T_JSBODY"
57
- - when: /\/\/[^\n]*/ tag: "T_JSBODY"
58
- - when: /\/\*.*\*\// tag: "T_JSBODY"
59
- string ->
60
- - when: /"(?:[^"\\\r\n]|\\.)*"/ tag: "T_STRING" highlight: "string"
61
- string2 ->
62
- - when: /'(?:[^'\\\r\n]|\\.)*'/ tag: "T_STRING" highlight: "string"
63
- string3 ->
64
- - when: /`(?:[^`\\]|\\.)*`/ tag: "T_STRING" highlight: "string"
65
- regex ->
66
- - when: /\/(?:[^\/\\\r\n]|\\.)+\// tag: "T_REGEX" highlight: "regexp"
67
- integer ->
68
- - when: /\d+/ tag: "T_INTEGER" highlight: "number"
69
- word ->
70
- - when: /[a-zA-Z_][a-zA-Z_\d]*/ tag: "T_WORD"
71
- ws ->
72
- - when: /\s+/ tag: "T_WS"
73
- l_colon ->
74
- - when: ":" tag: "L_COLON" highlight: "keyword"
75
- l_scolon ->
76
- - when: ";" tag: "L_SCOLON"
77
- l_qmark ->
78
- - when: "?" tag: "L_QMARK"
79
- l_plus ->
80
- - when: "+" tag: "L_PLUS"
81
- l_star ->
82
- - when: "*" tag: "L_STAR"
83
- l_comma ->
84
- - when: "," tag: "L_COMMA"
85
- l_pipe ->
86
- - when: "|" tag: "L_PIPE" highlight: "keyword"
87
- l_parenl ->
88
- - when: "(" tag: "L_PARENL"
89
- l_parenr ->
90
- - when: ")" tag: "L_PARENR"
91
- l_templatel ->
92
- - when: "{{" tag: "L_TEMPLATEL"
93
- l_templater ->
94
- - when: "}}" tag: "L_TEMPLATER"
95
- l_arrow ->
96
- - when: "->" tag: "L_ARROW" highlight: "keyword"
97
- l_dsign ->
98
- - when: "$" tag: "L_DSIGN"
99
- l_dash ->
100
- - when: "-" tag: "L_DASH"
101
- comment ->
102
- - when: /\/\/[^\n]*/ tag: "T_COMMENT" highlight: "comment"
103
- commentmulti ->
104
- - when: /\/\*.*\*\// tag: "T_COMMENT" highlight: "comment"
105
-
106
- }}
107
-
108
- grammar: {{
109
-
110
- main ->
111
- _ section_list _ : {{ $1 }}
112
-
113
- section_list ->
114
- section : {{ [$0] }}
115
- | section T_WS section_list : {{ [$0].concat($2) }}
116
-
117
- section ->
118
- K_CONFIG _ L_COLON _ L_TEMPLATEL _ kv_list:list _ L_TEMPLATER : {{ { config: Object.assign(...$list) } }}
119
- | K_IMPORT _ L_STAR _ K_FROM __ T_WORD:import _ L_SCOLON : {{ { import: $import } }}
120
- | K_IMPORT _ L_STAR _ K_FROM __ T_STRING:import _ L_SCOLON : {{ { import: $import, path: true } }}
121
- | K_LEXER _ L_COLON _ L_TEMPLATEL _ lexer:lexer _ L_TEMPLATER : {{ { lexer: Object.assign(...$lexer) } }}
122
- | K_GRAMMAR _ L_COLON _ L_TEMPLATEL _ grammar:grammar _ L_TEMPLATER : {{ { grammar: $grammar } }}
123
- | K_BODY _ L_COLON _ T_JS:js : {{ { body: $js } }}
124
- | K_BODY _ L_COLON _ T_STRING:js : {{ { body: $js, path: true } }}
125
- | K_HEAD _ L_COLON _ T_JS:js : {{ { head: $js } }}
126
- | K_HEAD _ L_COLON _ T_STRING:js : {{ { head: $js, path: true } }}
127
-
128
- lexer ->
129
- kv_list _ state_list : {{ $0.concat({ states: $2 }) }}
130
- | state_list : {{ [{ states: $0 }] }}
131
-
132
- state_list ->
133
- state : {{ data }}
134
- | state _ state_list : {{ [$0].concat($2) }}
135
-
136
- state ->
137
- state_declare _ state_definition : {{ Object.assign({ name: $0 }, $2) }}
138
-
139
- state_declare ->
140
- T_WORD _ L_ARROW : {{ $0 }}
141
-
142
- state_definition ->
143
- kv_list _ token_list : {{ Object.assign(...$0, { rules: $2 }) }}
144
- | token_list : {{ { rules: $0 } }}
145
-
146
- token_list ->
147
- token : {{ data }}
148
- | token _ token_list : {{ [$0].concat($2) }}
149
-
150
- token ->
151
- L_DASH _ K_IMPORT _ L_COLON _ word_list : {{ { import: $6 } }}
152
- | L_DASH _ token_definition_list : {{ Object.assign(...$2) }}
153
-
154
- token_definition_list ->
155
- token_definition : {{ data }}
156
- | token_definition _ token_definition_list : {{ [$0].concat($2) }}
157
-
158
- token_definition ->
159
- K_TAG _ L_COLON _ string_list : {{ { tag: $4 } }}
160
- | K_WHEN _ L_COLON _ T_STRING : {{ { when: $4 } }}
161
- | K_WHEN _ L_COLON _ T_REGEX : {{ { when: $4 } }}
162
- | K_POP : {{ { pop: 1 } }}
163
- | K_POP _ L_COLON _ T_INTEGER : {{ { pop: parseInt($4) } }}
164
- | K_POP _ L_COLON _ K_ALL : {{ { pop: "all" } }}
165
- | K_HIGHLIGHT _ L_COLON _ T_STRING : {{ { highlight: $4 } }}
166
- | K_INSET : {{ { inset: 1 } }}
167
- | K_INSET _ L_COLON _ T_INTEGER : {{ { inset: parseInt($4) } }}
168
- | K_SET _ L_COLON _ T_WORD : {{ { set: $4 } }}
169
- | K_GOTO _ L_COLON _ T_WORD : {{ { goto: $4 } }}
170
- | K_TYPE _ L_COLON _ T_STRING : {{ { type: $4 } }}
171
-
172
- grammar ->
173
- kv_list _ grammar_rule_list : {{ { config: Object.assign(...$0), rules: $2 } }}
174
- | grammar_rule_list : {{ { rules: $0 } }}
175
-
176
- grammar_rule_list ->
177
- grammar_rule : {{ [$0] }}
178
- | grammar_rule _ grammar_rule_list : {{ [$0].concat($2) }}
179
-
180
- grammar_rule ->
181
- T_WORD _ L_ARROW _ expression_list : {{ { name: $0, expressions: $4 } }}
182
- | T_WORD __ L_COLON _ T_JS:js _ L_ARROW _ expression_list:expressions : {{ { name: $0, expressions: $expressions, postprocess: $js } }}
183
- | T_WORD __ L_COLON _ T_GRAMMAR_TEMPLATE:template _ L_ARROW _ expression_list:expressions : {{ { name: $0, expressions: $expressions, postprocess: $template } }}
184
-
185
- expression_list ->
186
- expression
187
- | expression_list _ L_PIPE _ expression : {{ $0.concat([$4]) }}
188
-
189
- expression ->
190
- expression_symbol_list : {{ { symbols: $0 } }}
191
- | expression_symbol_list __ L_COLON _ T_JS:js : {{ { symbols: $0, postprocess: $js } }}
192
- | expression_symbol_list __ L_COLON _ T_GRAMMAR_TEMPLATE:template : {{ { symbols: $0, postprocess: $template } }}
193
-
194
- expression_symbol_list ->
195
- expression_symbol
196
- | expression_symbol_list T_WS expression_symbol : {{ $0.concat([$2]) }}
197
-
198
-
199
- expression_symbol ->
200
- expression_symbol_match : {{ $0 }}
201
- | expression_symbol_match L_COLON T_WORD : {{ { ...$0, alias: $2 } }}
202
- | expression_symbol_match expression_repeater : {{ { expression: $0, repeat: $1 } }}
203
- | expression_symbol_match expression_repeater L_COLON T_WORD : {{ { expression: $0, repeat: $1, alias: $4 } }}
204
-
205
-
206
- expression_symbol_match ->
207
- T_WORD : {{ { rule: $0 } }}
208
- | T_STRING "i"? : {{ { literal: $0, insensitive: !!$1 } }}
209
- | L_DSIGN T_WORD : {{ { token: $1} }}
210
- | L_DSIGN T_STRING : {{ { token: $1} }}
211
- | T_REGEX : {{ $0 }}
212
- | L_PARENL _ expression_list _ L_PARENR : {{ { subexpression: $2 } }}
213
- | T_JS : {{ $0 }}
214
-
215
- expression_repeater : {{ $0[0].value }} ->
216
- L_QMARK
217
- | L_PLUS
218
- | L_STAR
219
-
220
- kv_list ->
221
- kv : {{ data }}
222
- | kv _ kv_list : {{ [$0].concat($2) }}
223
-
224
- kv ->
225
- T_WORD _ L_COLON _ ( T_WORD| T_STRING| T_INTEGER | T_JS | T_GRAMMAR_TEMPLATE) : {{ { [$0]: $4[0] } }}
226
-
227
- string_list ->
228
- T_STRING : {{ [$0] }}
229
- | T_STRING _ L_COMMA _ string_list : {{ [$0].concat($4) }}
230
-
231
- word_list ->
232
- T_WORD : {{ [$0] }}
233
- | T_WORD _ L_COMMA _ word_list : {{ [$0].concat($4) }}
234
-
235
- _ ->
236
- ( T_WS | T_COMMENT )* : {{ null }}
237
-
238
- __ ->
239
- ( T_WS | T_COMMENT )+ : {{ null }}
240
-
241
- L_COLON -> $L_COLON
242
- L_SCOLON -> $L_SCOLON
243
- L_QMARK -> $L_QMARK
244
- L_PLUS -> $L_PLUS
245
- L_STAR -> $L_STAR
246
- L_COMMA -> $L_COMMA
247
- L_PIPE -> $L_PIPE
248
- L_PARENL -> $L_PARENL
249
- L_PARENR -> $L_PARENR
250
- L_TEMPLATEL -> $L_TEMPLATEL
251
- L_TEMPLATER -> $L_TEMPLATER
252
- L_ARROW -> $L_ARROW
253
- L_DSIGN -> $L_DSIGN
254
- L_DASH -> $L_DASH
255
-
256
- K_ALL -> "all"
257
- K_TAG -> "tag"
258
- K_FROM -> "from"
259
- K_TYPE -> "type"
260
- K_WHEN -> "when"
261
- K_POP -> "pop"
262
- K_HIGHLIGHT -> "highlight"
263
- K_INSET -> "inset"
264
- K_SET -> "set"
265
- K_GOTO -> "goto"
266
- K_CONFIG -> "config"
267
- K_LEXER -> "lexer"
268
- K_GRAMMAR -> "grammar"
269
- K_IMPORT -> "import"
270
- K_BODY -> "body"
271
- K_HEAD -> "head"
272
-
273
- T_JS -> $L_JSL $T_JSBODY* $L_JSR : {{ { js: $1.map(v=>v.value).join('') } }}
274
- T_GRAMMAR_TEMPLATE -> $L_TEMPLATEL _ $T_JSBODY* _ $L_TEMPLATER : {{ { template: $2.map(v=>v.value).join('').trim() } }}
275
- T_STRING -> $T_STRING : {{ JSON.parse($0.value) }}
276
- T_WORD -> $T_WORD : {{ $0.value }}
277
- T_REGEX -> $T_REGEX /[gmiuy]/* : {{ { regex: $0.value.replace(/\\\\\//g,'/').slice(1,-1), flags: $1.map(v=>v.value).join('').trim() } }}
278
- T_COMMENT -> $T_COMMENT
279
- T_INTEGER -> $T_INTEGER : {{ $0.value }}
280
- T_WS -> $T_WS : {{ null }}
281
- }}