@bablr/language-en-json 0.9.0 → 0.10.0
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/lib/grammar.js +44 -47
- package/lib/grammar.macro.js +48 -43
- package/package.json +7 -7
package/lib/grammar.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
/* @macrome
|
|
2
2
|
* @generatedby @bablr/macrome-generator-bablr
|
|
3
|
-
* @generatedfrom ./grammar.macro.js#
|
|
3
|
+
* @generatedfrom ./grammar.macro.js#4b2e4ce356a3a29eb03d3816de446f8e8e0adfa1
|
|
4
4
|
* This file is autogenerated. Please do not edit it directly.
|
|
5
5
|
* When editing run `npx macrome watch` then change the file this is generated from.
|
|
6
6
|
*/
|
|
7
7
|
import _applyDecs from "@babel/runtime/helpers/applyDecs2305";
|
|
8
|
-
let _initProto, _ExpressionDecs, _ArrayDecs, _ObjectDecs, _NumberDecs, _InfinityDecs, _BooleanDecs, _NullDecs, _KeywordDecs, _PunctuatorDecs, _ListDecs, _AnyDecs, _AllDecs;
|
|
8
|
+
let _initProto, _ExpressionDecs, _ArrayDecs, _ObjectDecs, _StringDecs, _NumberDecs, _InfinityDecs, _BooleanDecs, _NullDecs, _KeywordDecs, _PunctuatorDecs, _ListDecs, _AnyDecs, _AllDecs;
|
|
9
9
|
import { re, spam as m } from '@bablr/boot';
|
|
10
10
|
import { triviaEnhancer } from '@bablr/helpers/trivia';
|
|
11
11
|
import * as productions from '@bablr/helpers/productions';
|
|
12
12
|
import { o, eat, eatMatch, match, fail } from '@bablr/helpers/grammar';
|
|
13
13
|
import { buildString, buildIdentifier } from '@bablr/helpers/builders';
|
|
14
|
-
import { Node, CoveredBy, AllowEmpty, InjectFrom } from '@bablr/helpers/decorators';
|
|
14
|
+
import { Node, CoveredBy, AllowEmpty, InjectFrom, Literal } from '@bablr/helpers/decorators';
|
|
15
15
|
import * as Space from '@bablr/language-en-blank-space';
|
|
16
|
-
import { getEmbeddedObject } from '@bablr/agast-vm-helpers/deembed';
|
|
17
16
|
export const dependencies = {
|
|
18
17
|
Space
|
|
19
18
|
};
|
|
@@ -44,7 +43,7 @@ export const getCooked = (escapeNode, span, ctx) => {
|
|
|
44
43
|
throw new Error('not implemented');
|
|
45
44
|
}
|
|
46
45
|
if (type === 'u') {
|
|
47
|
-
cooked = parseInt(value, 16);
|
|
46
|
+
cooked = String.fromCharCode(parseInt(value, 16));
|
|
48
47
|
} else {
|
|
49
48
|
throw new Error();
|
|
50
49
|
}
|
|
@@ -53,31 +52,29 @@ export const getCooked = (escapeNode, span, ctx) => {
|
|
|
53
52
|
};
|
|
54
53
|
export const grammar = triviaEnhancer({
|
|
55
54
|
triviaIsAllowed: s => s.span === 'Bare',
|
|
56
|
-
|
|
57
|
-
if (yield match(re`/[ \n\r\t]/`)) {
|
|
58
|
-
yield eat(m`#: <*Space:Space />`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
55
|
+
triviaMatcher: m`#: <*Space:Space /[ \n\r\t]/ />`
|
|
61
56
|
}, class JSONGrammar {
|
|
62
57
|
static {
|
|
63
|
-
[_initProto] = _applyDecs(this, [[_ExpressionDecs, 2, "Expression"], [_ArrayDecs, 2, "Array"], [_ObjectDecs, 2, "Object"], [Node, 2, "Property"], [Node, 2, "Identifier"], [
|
|
58
|
+
[_initProto] = _applyDecs(this, [[_ExpressionDecs, 2, "Expression"], [_ArrayDecs, 2, "Array"], [_ObjectDecs, 2, "Object"], [Node, 2, "Property"], [Node, 2, "Identifier"], [_StringDecs, 2, "String"], [[AllowEmpty, Node], 2, "StringContent"], [Node, 2, "EscapeSequence"], [Node, 2, "EscapeCode"], [_NumberDecs, 2, "Number"], [Node, 2, "Integer"], [Node, 2, "UnsignedInteger"], [Node, 2, "UnsignedHexInteger"], [_InfinityDecs, 2, "Infinity"], [_BooleanDecs, 2, "Boolean"], [_NullDecs, 2, "Null"], [_KeywordDecs, 2, "Keyword"], [_PunctuatorDecs, 2, "Punctuator"], [_ListDecs, 2, "List"], [_AnyDecs, 2, "Any"], [_AllDecs, 2, "All"]], []).e;
|
|
64
59
|
}
|
|
65
60
|
constructor() {
|
|
66
61
|
_initProto(this);
|
|
67
62
|
}
|
|
68
|
-
*[(_ExpressionDecs = CoveredBy('Element'), _ArrayDecs = [CoveredBy('Expression'), Node], _ObjectDecs = [CoveredBy('Expression'), Node], _NumberDecs = [CoveredBy('Expression'), Node], _InfinityDecs = [CoveredBy('Expression'), Node], _BooleanDecs = [CoveredBy('Expression'), Node], _NullDecs = [CoveredBy('Expression'), Node], _KeywordDecs = [Node, InjectFrom(productions)], _PunctuatorDecs = [Node, InjectFrom(productions)], _ListDecs = [AllowEmpty, InjectFrom(productions)], _AnyDecs = InjectFrom(productions), _AllDecs = InjectFrom(productions), Symbol.for('@bablr/fragment'))]({
|
|
69
|
-
|
|
63
|
+
*[(_ExpressionDecs = CoveredBy('Element'), _ArrayDecs = [CoveredBy('Expression'), Node], _ObjectDecs = [CoveredBy('Expression'), Node], _StringDecs = [CoveredBy('Expression'), Node], _NumberDecs = [CoveredBy('Expression'), Node], _InfinityDecs = [CoveredBy('Expression'), Node], _BooleanDecs = [CoveredBy('Expression'), Node], _NullDecs = [CoveredBy('Expression'), Node], _KeywordDecs = [Literal, Node, InjectFrom(productions)], _PunctuatorDecs = [Literal, Node, InjectFrom(productions)], _ListDecs = [AllowEmpty, InjectFrom(productions)], _AnyDecs = InjectFrom(productions), _AllDecs = InjectFrom(productions), Symbol.for('@bablr/fragment'))]({
|
|
64
|
+
props: {
|
|
65
|
+
rootMatcher
|
|
66
|
+
}
|
|
70
67
|
}) {
|
|
71
68
|
// needed for the trivia plugin
|
|
72
|
-
yield eat(
|
|
69
|
+
yield eat(rootMatcher);
|
|
73
70
|
}
|
|
74
71
|
*Expression() {
|
|
75
|
-
yield eat(m`<
|
|
72
|
+
yield eat(m`<_Any />`, [m`<Array '[' />`, m`<Object '{' />`, m`<String /['"]/ />`, m`<Number /\d|-[\d\g]/ {span: 'Number'} />`, m`<Infinity /-?Infinity/ />`, m`<Null 'null' />`, m`<Boolean /true|false/ />`]);
|
|
76
73
|
}
|
|
77
74
|
*Array() {
|
|
78
75
|
yield eat(m`openToken: <*Punctuator '[' { balanced: ']' } />`);
|
|
79
|
-
yield eat(m`<
|
|
80
|
-
element: m`elements[]
|
|
76
|
+
yield eat(m`<_List />`, o({
|
|
77
|
+
element: m`elements[]+$: <__Expression />`,
|
|
81
78
|
separator: m`separatorTokens[]: <*Punctuator ',' />`,
|
|
82
79
|
allowTrailingSeparator: false
|
|
83
80
|
}));
|
|
@@ -89,7 +86,7 @@ export const grammar = triviaEnhancer({
|
|
|
89
86
|
yield eatMatch(m`separatorTokens[]: []`);
|
|
90
87
|
yield eatMatch(m`properties[]$: []`);
|
|
91
88
|
while (sep && (yield match(re`/.|\g/s`))) {
|
|
92
|
-
let suppressGap = !!(yield match(m`<
|
|
89
|
+
let suppressGap = !!(yield match(m`<_All />`, [m`key: <//>`, m`sigilToken: <*Punctuator ':' />`]));
|
|
93
90
|
yield eat(m`properties[]$: <Property />`, null, o({
|
|
94
91
|
suppressGap
|
|
95
92
|
}));
|
|
@@ -100,7 +97,7 @@ export const grammar = triviaEnhancer({
|
|
|
100
97
|
*Property() {
|
|
101
98
|
yield eat(m`key$: <*Identifier />`);
|
|
102
99
|
yield eat(m`sigilToken: <*Punctuator ':' />`);
|
|
103
|
-
yield eat(m`value
|
|
100
|
+
yield eat(m`value+$: <__Expression />`);
|
|
104
101
|
}
|
|
105
102
|
*Identifier() {
|
|
106
103
|
yield eat(re`/[a-zA-Z][a-zA-Z_-]*/`);
|
|
@@ -148,11 +145,13 @@ export const grammar = triviaEnhancer({
|
|
|
148
145
|
}
|
|
149
146
|
*EscapeCode() {
|
|
150
147
|
if (yield eatMatch(m`typeToken: <*Keyword 'u' />`)) {
|
|
151
|
-
if (yield eatMatch(m`openToken: <*Punctuator '{' { balanced: '}' }
|
|
152
|
-
|
|
148
|
+
if (yield eatMatch(m`openToken: <*Punctuator '{' { balanced: '}' } />`, null, o({
|
|
149
|
+
bind: true
|
|
150
|
+
}))) {
|
|
151
|
+
yield eat(m`value$: <*UnsignedHexInteger />`);
|
|
153
152
|
yield eat(m`closeToken: <*Punctuator '}' { balancer: true } />`);
|
|
154
153
|
} else {
|
|
155
|
-
yield eat(m`value$: <*
|
|
154
|
+
yield eat(m`value$: <*UnsignedHexInteger /[\da-fA-F]{4}/ />`);
|
|
156
155
|
yield eat(m`closeToken: null`);
|
|
157
156
|
}
|
|
158
157
|
}
|
|
@@ -162,13 +161,17 @@ export const grammar = triviaEnhancer({
|
|
|
162
161
|
noDoubleZero: true,
|
|
163
162
|
matchSign: '-'
|
|
164
163
|
}));
|
|
165
|
-
let fs = yield eatMatch(m`fractionalSeparatorToken: <*Punctuator '.'
|
|
164
|
+
let fs = yield eatMatch(m`fractionalSeparatorToken: <*Punctuator '.' />`, null, o({
|
|
165
|
+
bind: true
|
|
166
|
+
}));
|
|
166
167
|
if (fs) {
|
|
167
|
-
yield eat(m`fractionalPart$:
|
|
168
|
+
yield eat(m`fractionalPart$: <*UnsignedInteger />`);
|
|
168
169
|
} else {
|
|
169
170
|
yield eat(m`fractionalPart$: null`);
|
|
170
171
|
}
|
|
171
|
-
let es = yield eatMatch(m`exponentSeparatorToken: <*Punctuator /[eE]/
|
|
172
|
+
let es = yield eatMatch(m`exponentSeparatorToken: <*Punctuator /[eE]/ />`, null, o({
|
|
173
|
+
bind: true
|
|
174
|
+
}));
|
|
172
175
|
if (es) {
|
|
173
176
|
yield eat(m`exponentPart$: <Integer />`, {
|
|
174
177
|
matchSign: /[+-]/
|
|
@@ -178,14 +181,15 @@ export const grammar = triviaEnhancer({
|
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
183
|
*Integer({
|
|
181
|
-
|
|
182
|
-
}) {
|
|
183
|
-
const {
|
|
184
|
+
props: {
|
|
184
185
|
matchSign = null,
|
|
185
186
|
noDoubleZero = false
|
|
186
|
-
}
|
|
187
|
+
}
|
|
188
|
+
}) {
|
|
187
189
|
if (matchSign) {
|
|
188
|
-
yield eatMatch(m`signToken: <*Punctuator ${buildString(matchSign)}
|
|
190
|
+
yield eatMatch(m`signToken: <*Punctuator ${buildString(matchSign)} />`, null, o({
|
|
191
|
+
bind: true
|
|
192
|
+
}));
|
|
189
193
|
} else {
|
|
190
194
|
yield eat(m`signToken: null`);
|
|
191
195
|
}
|
|
@@ -194,19 +198,23 @@ export const grammar = triviaEnhancer({
|
|
|
194
198
|
}));
|
|
195
199
|
}
|
|
196
200
|
*UnsignedInteger({
|
|
197
|
-
|
|
201
|
+
props: {
|
|
202
|
+
noDoubleZero = false
|
|
203
|
+
},
|
|
198
204
|
ctx
|
|
199
205
|
}) {
|
|
200
|
-
const {
|
|
201
|
-
noDoubleZero = false
|
|
202
|
-
} = props || {};
|
|
203
206
|
let firstDigit = ctx.sourceTextFor(yield eat(re`/\d/`));
|
|
204
207
|
if (!noDoubleZero || firstDigit.value !== '0') {
|
|
205
208
|
yield eatMatch(re`/\d+/`);
|
|
206
209
|
}
|
|
207
210
|
}
|
|
211
|
+
*UnsignedHexInteger() {
|
|
212
|
+
yield eatMatch(re`/[\da-fA-F]+/`);
|
|
213
|
+
}
|
|
208
214
|
*Infinity() {
|
|
209
|
-
yield eatMatch(m`signToken: <*Punctuator '-'
|
|
215
|
+
yield eatMatch(m`signToken: <*Punctuator '-' />`, null, o({
|
|
216
|
+
bind: true
|
|
217
|
+
}));
|
|
210
218
|
yield eat(m`sigilToken: <*Keyword 'Infinity' />`);
|
|
211
219
|
}
|
|
212
220
|
*Boolean() {
|
|
@@ -220,15 +228,4 @@ export const grammar = triviaEnhancer({
|
|
|
220
228
|
*List() {}
|
|
221
229
|
*Any() {}
|
|
222
230
|
*All() {}
|
|
223
|
-
});
|
|
224
|
-
export const YJSON = self => {
|
|
225
|
-
return {
|
|
226
|
-
dependencies: {
|
|
227
|
-
...dependencies,
|
|
228
|
-
Y: self
|
|
229
|
-
},
|
|
230
|
-
canonicalURL,
|
|
231
|
-
getCooked,
|
|
232
|
-
grammar
|
|
233
|
-
};
|
|
234
|
-
};
|
|
231
|
+
});
|
package/lib/grammar.macro.js
CHANGED
|
@@ -3,9 +3,8 @@ import { triviaEnhancer } from '@bablr/helpers/trivia';
|
|
|
3
3
|
import * as productions from '@bablr/helpers/productions';
|
|
4
4
|
import { o, eat, eatMatch, match, fail } from '@bablr/helpers/grammar';
|
|
5
5
|
import { buildString, buildIdentifier } from '@bablr/helpers/builders';
|
|
6
|
-
import { Node, CoveredBy, AllowEmpty, InjectFrom } from '@bablr/helpers/decorators';
|
|
6
|
+
import { Node, CoveredBy, AllowEmpty, InjectFrom, Literal } from '@bablr/helpers/decorators';
|
|
7
7
|
import * as Space from '@bablr/language-en-blank-space';
|
|
8
|
-
import { getEmbeddedObject } from '@bablr/agast-vm-helpers/deembed';
|
|
9
8
|
|
|
10
9
|
export const dependencies = { Space };
|
|
11
10
|
|
|
@@ -43,7 +42,7 @@ export const getCooked = (escapeNode, span, ctx) => {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
if (type === 'u') {
|
|
46
|
-
cooked = parseInt(value, 16);
|
|
45
|
+
cooked = String.fromCharCode(parseInt(value, 16));
|
|
47
46
|
} else {
|
|
48
47
|
throw new Error();
|
|
49
48
|
}
|
|
@@ -55,26 +54,22 @@ export const getCooked = (escapeNode, span, ctx) => {
|
|
|
55
54
|
export const grammar = triviaEnhancer(
|
|
56
55
|
{
|
|
57
56
|
triviaIsAllowed: (s) => s.span === 'Bare',
|
|
58
|
-
|
|
59
|
-
if (yield match(re`/[ \n\r\t]/`)) {
|
|
60
|
-
yield eat(m`#: <*Space:Space />`);
|
|
61
|
-
}
|
|
62
|
-
},
|
|
57
|
+
triviaMatcher: m`#: <*Space:Space /[ \n\r\t]/ />`,
|
|
63
58
|
},
|
|
64
59
|
class JSONGrammar {
|
|
65
|
-
*[Symbol.for('@bablr/fragment')]({
|
|
60
|
+
*[Symbol.for('@bablr/fragment')]({ props: { rootMatcher } }) {
|
|
66
61
|
// needed for the trivia plugin
|
|
67
|
-
yield eat(
|
|
62
|
+
yield eat(rootMatcher);
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
@CoveredBy('Element')
|
|
71
66
|
*Expression() {
|
|
72
|
-
yield eat(m`<
|
|
67
|
+
yield eat(m`<_Any />`, [
|
|
73
68
|
m`<Array '[' />`,
|
|
74
69
|
m`<Object '{' />`,
|
|
75
70
|
m`<String /['"]/ />`,
|
|
76
|
-
m`<Number
|
|
77
|
-
m`<Infinity
|
|
71
|
+
m`<Number /\d|-[\d\g]/ {span: 'Number'} />`,
|
|
72
|
+
m`<Infinity /-?Infinity/ />`,
|
|
78
73
|
m`<Null 'null' />`,
|
|
79
74
|
m`<Boolean /true|false/ />`,
|
|
80
75
|
]);
|
|
@@ -85,9 +80,9 @@ export const grammar = triviaEnhancer(
|
|
|
85
80
|
*Array() {
|
|
86
81
|
yield eat(m`openToken: <*Punctuator '[' { balanced: ']' } />`);
|
|
87
82
|
yield eat(
|
|
88
|
-
m`<
|
|
83
|
+
m`<_List />`,
|
|
89
84
|
o({
|
|
90
|
-
element: m`elements[]
|
|
85
|
+
element: m`elements[]+$: <__Expression />`,
|
|
91
86
|
separator: m`separatorTokens[]: <*Punctuator ',' />`,
|
|
92
87
|
allowTrailingSeparator: false,
|
|
93
88
|
}),
|
|
@@ -105,7 +100,7 @@ export const grammar = triviaEnhancer(
|
|
|
105
100
|
yield eatMatch(m`properties[]$: []`);
|
|
106
101
|
|
|
107
102
|
while (sep && (yield match(re`/.|\g/s`))) {
|
|
108
|
-
let suppressGap = !!(yield match(m`<
|
|
103
|
+
let suppressGap = !!(yield match(m`<_All />`, [
|
|
109
104
|
m`key: <//>`,
|
|
110
105
|
m`sigilToken: <*Punctuator ':' />`,
|
|
111
106
|
]));
|
|
@@ -119,7 +114,7 @@ export const grammar = triviaEnhancer(
|
|
|
119
114
|
*Property() {
|
|
120
115
|
yield eat(m`key$: <*Identifier />`);
|
|
121
116
|
yield eat(m`sigilToken: <*Punctuator ':' />`);
|
|
122
|
-
yield eat(m`value
|
|
117
|
+
yield eat(m`value+$: <__Expression />`);
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
@Node
|
|
@@ -127,6 +122,7 @@ export const grammar = triviaEnhancer(
|
|
|
127
122
|
yield eat(re`/[a-zA-Z][a-zA-Z_-]*/`);
|
|
128
123
|
}
|
|
129
124
|
|
|
125
|
+
@CoveredBy('Expression')
|
|
130
126
|
@Node
|
|
131
127
|
*String({ ctx }) {
|
|
132
128
|
let q = yield match(re`/['"]/`);
|
|
@@ -185,11 +181,17 @@ export const grammar = triviaEnhancer(
|
|
|
185
181
|
@Node
|
|
186
182
|
*EscapeCode() {
|
|
187
183
|
if (yield eatMatch(m`typeToken: <*Keyword 'u' />`)) {
|
|
188
|
-
if (
|
|
189
|
-
yield
|
|
184
|
+
if (
|
|
185
|
+
yield eatMatch(
|
|
186
|
+
m`openToken: <*Punctuator '{' { balanced: '}' } />`,
|
|
187
|
+
null,
|
|
188
|
+
o({ bind: true }),
|
|
189
|
+
)
|
|
190
|
+
) {
|
|
191
|
+
yield eat(m`value$: <*UnsignedHexInteger />`);
|
|
190
192
|
yield eat(m`closeToken: <*Punctuator '}' { balancer: true } />`);
|
|
191
193
|
} else {
|
|
192
|
-
yield eat(m`value$: <*
|
|
194
|
+
yield eat(m`value$: <*UnsignedHexInteger /[\da-fA-F]{4}/ />`);
|
|
193
195
|
yield eat(m`closeToken: null`);
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -200,15 +202,23 @@ export const grammar = triviaEnhancer(
|
|
|
200
202
|
*Number() {
|
|
201
203
|
yield eat(m`wholePart$: <Integer />`, o({ noDoubleZero: true, matchSign: '-' }));
|
|
202
204
|
|
|
203
|
-
let fs = yield eatMatch(
|
|
205
|
+
let fs = yield eatMatch(
|
|
206
|
+
m`fractionalSeparatorToken: <*Punctuator '.' />`,
|
|
207
|
+
null,
|
|
208
|
+
o({ bind: true }),
|
|
209
|
+
);
|
|
204
210
|
|
|
205
211
|
if (fs) {
|
|
206
|
-
yield eat(m`fractionalPart$:
|
|
212
|
+
yield eat(m`fractionalPart$: <*UnsignedInteger />`);
|
|
207
213
|
} else {
|
|
208
214
|
yield eat(m`fractionalPart$: null`);
|
|
209
215
|
}
|
|
210
216
|
|
|
211
|
-
let es = yield eatMatch(
|
|
217
|
+
let es = yield eatMatch(
|
|
218
|
+
m`exponentSeparatorToken: <*Punctuator /[eE]/ />`,
|
|
219
|
+
null,
|
|
220
|
+
o({ bind: true }),
|
|
221
|
+
);
|
|
212
222
|
|
|
213
223
|
if (es) {
|
|
214
224
|
yield eat(m`exponentPart$: <Integer />`, { matchSign: /[+-]/ });
|
|
@@ -218,11 +228,13 @@ export const grammar = triviaEnhancer(
|
|
|
218
228
|
}
|
|
219
229
|
|
|
220
230
|
@Node
|
|
221
|
-
*Integer({
|
|
222
|
-
const { matchSign = null, noDoubleZero = false } = props ? getEmbeddedObject(props) : {};
|
|
223
|
-
|
|
231
|
+
*Integer({ props: { matchSign = null, noDoubleZero = false } }) {
|
|
224
232
|
if (matchSign) {
|
|
225
|
-
yield eatMatch(
|
|
233
|
+
yield eatMatch(
|
|
234
|
+
m`signToken: <*Punctuator ${buildString(matchSign)} />`,
|
|
235
|
+
null,
|
|
236
|
+
o({ bind: true }),
|
|
237
|
+
);
|
|
226
238
|
} else {
|
|
227
239
|
yield eat(m`signToken: null`);
|
|
228
240
|
}
|
|
@@ -231,9 +243,7 @@ export const grammar = triviaEnhancer(
|
|
|
231
243
|
}
|
|
232
244
|
|
|
233
245
|
@Node
|
|
234
|
-
*UnsignedInteger({
|
|
235
|
-
const { noDoubleZero = false } = props || {};
|
|
236
|
-
|
|
246
|
+
*UnsignedInteger({ props: { noDoubleZero = false }, ctx }) {
|
|
237
247
|
let firstDigit = ctx.sourceTextFor(yield eat(re`/\d/`));
|
|
238
248
|
|
|
239
249
|
if (!noDoubleZero || firstDigit.value !== '0') {
|
|
@@ -241,10 +251,15 @@ export const grammar = triviaEnhancer(
|
|
|
241
251
|
}
|
|
242
252
|
}
|
|
243
253
|
|
|
254
|
+
@Node
|
|
255
|
+
*UnsignedHexInteger() {
|
|
256
|
+
yield eatMatch(re`/[\da-fA-F]+/`);
|
|
257
|
+
}
|
|
258
|
+
|
|
244
259
|
@CoveredBy('Expression')
|
|
245
260
|
@Node
|
|
246
261
|
*Infinity() {
|
|
247
|
-
yield eatMatch(m`signToken: <*Punctuator '-'
|
|
262
|
+
yield eatMatch(m`signToken: <*Punctuator '-' />`, null, o({ bind: true }));
|
|
248
263
|
yield eat(m`sigilToken: <*Keyword 'Infinity' />`);
|
|
249
264
|
}
|
|
250
265
|
|
|
@@ -260,10 +275,12 @@ export const grammar = triviaEnhancer(
|
|
|
260
275
|
yield eat(m`sigilToken: <*Keyword 'null' />`);
|
|
261
276
|
}
|
|
262
277
|
|
|
278
|
+
@Literal
|
|
263
279
|
@Node
|
|
264
280
|
@InjectFrom(productions)
|
|
265
281
|
*Keyword() {}
|
|
266
282
|
|
|
283
|
+
@Literal
|
|
267
284
|
@Node
|
|
268
285
|
@InjectFrom(productions)
|
|
269
286
|
*Punctuator() {}
|
|
@@ -279,15 +296,3 @@ export const grammar = triviaEnhancer(
|
|
|
279
296
|
*All() {}
|
|
280
297
|
},
|
|
281
298
|
);
|
|
282
|
-
|
|
283
|
-
export const YJSON = (self) => {
|
|
284
|
-
return {
|
|
285
|
-
dependencies: {
|
|
286
|
-
...dependencies,
|
|
287
|
-
Y: self,
|
|
288
|
-
},
|
|
289
|
-
canonicalURL,
|
|
290
|
-
getCooked,
|
|
291
|
-
grammar,
|
|
292
|
-
};
|
|
293
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-json",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A BABLR language for JSON",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@bablr/agast-helpers": "0.
|
|
25
|
-
"@bablr/agast-vm-helpers": "0.
|
|
26
|
-
"@bablr/boot": "0.
|
|
27
|
-
"@bablr/helpers": "0.
|
|
28
|
-
"@bablr/language-en-blank-space": "0.
|
|
24
|
+
"@bablr/agast-helpers": "0.7.1",
|
|
25
|
+
"@bablr/agast-vm-helpers": "0.7.1",
|
|
26
|
+
"@bablr/boot": "0.8.1",
|
|
27
|
+
"@bablr/helpers": "0.22.1",
|
|
28
|
+
"@bablr/language-en-blank-space": "0.7.0",
|
|
29
29
|
"@babel/runtime": "^7.22.15"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@bablr/macrome": "^0.1.3",
|
|
34
34
|
"@bablr/macrome-generator-bablr": "^0.3.2",
|
|
35
35
|
"@qnighy/dedent": "0.1.1",
|
|
36
|
-
"bablr": "^0.
|
|
36
|
+
"bablr": "^0.7.0",
|
|
37
37
|
"enhanced-resolve": "^5.12.0",
|
|
38
38
|
"eslint": "^7.32.0",
|
|
39
39
|
"eslint-import-resolver-enhanced-resolve": "^1.0.5",
|