@bablr/language-en-json 0.13.0 → 0.13.2
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 +6 -4
- package/package.json +7 -7
package/lib/grammar.js
CHANGED
|
@@ -102,7 +102,7 @@ export const grammar = class JSONGrammar {
|
|
|
102
102
|
yield* eatMatchTrivia();
|
|
103
103
|
yield eat(m`sigilToken*: <* ':' />`);
|
|
104
104
|
yield* eatMatchTrivia();
|
|
105
|
-
yield eat(m`value
|
|
105
|
+
yield eat(m`value$: <_Expression />`);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
*String() {
|
|
@@ -121,7 +121,9 @@ export const grammar = class JSONGrammar {
|
|
|
121
121
|
} while (esc || lit);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
*EscapeSequence() {
|
|
124
|
+
*EscapeSequence({ ctx }) {
|
|
125
|
+
let { getGapNode } = ctx;
|
|
126
|
+
|
|
125
127
|
yield startSpan('Escape');
|
|
126
128
|
yield eat(m`sigilToken*: <* '\\' />`);
|
|
127
129
|
|
|
@@ -139,7 +141,7 @@ export const grammar = class JSONGrammar {
|
|
|
139
141
|
const type = printSource(get('typeToken', codeNode.node));
|
|
140
142
|
|
|
141
143
|
if (type) {
|
|
142
|
-
const value = printSource(get('value', codeNode.node));
|
|
144
|
+
const value = printSource(getGapNode(get('value', codeNode.node)));
|
|
143
145
|
|
|
144
146
|
if (type === 'u') {
|
|
145
147
|
cooked = String.fromCharCode(parseInt(value, 16));
|
|
@@ -147,7 +149,7 @@ export const grammar = class JSONGrammar {
|
|
|
147
149
|
throw new Error();
|
|
148
150
|
}
|
|
149
151
|
} else {
|
|
150
|
-
let value = printSource(codeNode.node);
|
|
152
|
+
let value = printSource(codeNode.node, { getGapNode });
|
|
151
153
|
cooked = escapables.get(value) || value;
|
|
152
154
|
}
|
|
153
155
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-json",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "A BABLR language for JSON",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@bablr/agast-helpers": "0.10.
|
|
22
|
-
"@bablr/agast-vm-helpers": "0.10.
|
|
23
|
-
"@bablr/boot": "0.11.
|
|
24
|
-
"@bablr/helpers": "0.25.
|
|
25
|
-
"@bablr/language-en-blank-space": "0.10.
|
|
21
|
+
"@bablr/agast-helpers": "0.10.4",
|
|
22
|
+
"@bablr/agast-vm-helpers": "0.10.4",
|
|
23
|
+
"@bablr/boot": "0.11.3",
|
|
24
|
+
"@bablr/helpers": "0.25.2",
|
|
25
|
+
"@bablr/language-en-blank-space": "0.10.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#c97bfa4b3663f8378e9b3e42bb5a41e685406cf9",
|
|
29
29
|
"@qnighy/dedent": "0.1.1",
|
|
30
|
-
"bablr": "^0.11.
|
|
30
|
+
"bablr": "^0.11.3",
|
|
31
31
|
"enhanced-resolve": "^5.12.0",
|
|
32
32
|
"eslint": "^7.32.0",
|
|
33
33
|
"eslint-import-resolver-enhanced-resolve": "^1.0.5",
|