@bablr/language-en-esnext 0.1.0 → 0.2.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/es2018.js +23 -10
- package/lib/es2018.macro.js +27 -8
- package/lib/es2020.js +7 -6
- package/lib/es2020.macro.js +7 -5
- package/package.json +8 -8
package/lib/es2018.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
/* @macrome
|
|
2
2
|
* @generatedby @bablr/macrome-generator-bablr
|
|
3
|
-
* @generatedfrom ./es2018.macro.js#
|
|
3
|
+
* @generatedfrom ./es2018.macro.js#2a257f8c5cef6055c314c2fe5668662cee068d42
|
|
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
8
|
var _es2017$atrivialGramm;
|
|
9
9
|
let _initProto, _ObjectDecs;
|
|
10
|
-
import {
|
|
11
|
-
import { CoveredBy, Node
|
|
12
|
-
import { o,
|
|
10
|
+
import { spam as m } from '@bablr/boot';
|
|
11
|
+
import { CoveredBy, Node } from '@bablr/helpers/decorators';
|
|
12
|
+
import { o, eat, eatMatch } from '@bablr/helpers/grammar';
|
|
13
13
|
import { triviaEnhancer } from '@bablr/helpers/trivia';
|
|
14
14
|
import * as Comment from '@bablr/language-en-c-comments';
|
|
15
15
|
import * as es2017 from './es2017.js';
|
|
16
16
|
export const dependencies = {
|
|
17
17
|
Comment
|
|
18
18
|
};
|
|
19
|
+
export const defaultMatcher = m`.+: <_Expression />`;
|
|
19
20
|
export { powerLevels, reservedWords, assignmentOperators, assignmentOperatorAlternatives, unaryPrefixOperators, unaryPrefixOperatorAlternatives, unaryPostfixOperators, unaryPostfixOperatorAlternatives, getBinaryOperatorAlternatives } from './es2017.js';
|
|
20
21
|
export const canonicalURL = 'https://bablr.org/languages/universe/es6';
|
|
21
22
|
export const atrivialGrammar = class ES2018Grammar extends (_es2017$atrivialGramm = es2017.atrivialGrammar) {
|
|
22
23
|
static {
|
|
23
|
-
[_initProto] = _applyDecs(this, [[_ObjectDecs, 2, "Object"], [Node, 2, "SpreadElement"]], [], 0, void 0, _es2017$atrivialGramm).e;
|
|
24
|
+
[_initProto] = _applyDecs(this, [[_ObjectDecs, 2, "Object"], [Node, 2, "ObjectPattern"], [Node, 2, "SpreadElement"]], [], 0, void 0, _es2017$atrivialGramm).e;
|
|
24
25
|
}
|
|
25
26
|
constructor(...args) {
|
|
26
27
|
super(...args);
|
|
@@ -28,9 +29,9 @@ export const atrivialGrammar = class ES2018Grammar extends (_es2017$atrivialGram
|
|
|
28
29
|
}
|
|
29
30
|
*[(_ObjectDecs = [CoveredBy('JSONExpression'), CoveredBy('Expression'), Node], "Object")]() {
|
|
30
31
|
yield eat(m`open: <*Punctuator '{' { balanced: '}' } />`);
|
|
31
|
-
yield eat(m`properties[]$: <
|
|
32
|
-
element: m`<
|
|
33
|
-
separator: m
|
|
32
|
+
yield eat(m`properties[]$: <__List />`, o({
|
|
33
|
+
element: m`<_ObjectMember />`,
|
|
34
|
+
separator: m`#separatorTokens[]: <*Punctuator ',' />`,
|
|
34
35
|
allowTrailingSeparator: true
|
|
35
36
|
}));
|
|
36
37
|
yield eat(m`close: <*Punctuator '}' { balancer: true } />`);
|
|
@@ -40,14 +41,26 @@ export const atrivialGrammar = class ES2018Grammar extends (_es2017$atrivialGram
|
|
|
40
41
|
yield eat(m`<Property />`);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
44
|
+
*ObjectPattern() {
|
|
45
|
+
yield eat(m`openToken: <*Punctuator '{' { balanced: '}' } />`);
|
|
46
|
+
yield eat(m`params[]+$: <__List />`, o({
|
|
47
|
+
element: m`<PropertyPattern />`,
|
|
48
|
+
allowTrailingSeparator: true,
|
|
49
|
+
separator: m`#separatorTokens[]: <*Punctuator ',' />`
|
|
50
|
+
}));
|
|
51
|
+
if (yield eatMatch(m`params[]+$: <SpreadElement '...' />`)) {
|
|
52
|
+
yield eatMatch(m`#separatorTokens[]: <*Punctuator ',' />`);
|
|
53
|
+
}
|
|
54
|
+
yield eat(m`closeToken: <*Punctuator '}' { balancer: true } />`);
|
|
55
|
+
}
|
|
43
56
|
*SpreadElement() {
|
|
44
57
|
yield eat(m`sigilToken: <*Punctuator '...' />`);
|
|
45
|
-
yield eat(m`value+$: <
|
|
58
|
+
yield eat(m`value+$: <_Expression />`, o({
|
|
46
59
|
power: 32
|
|
47
60
|
}));
|
|
48
61
|
}
|
|
49
62
|
};
|
|
50
63
|
export const grammar = triviaEnhancer({
|
|
51
64
|
triviaIsAllowed: s => s.span === 'Bare',
|
|
52
|
-
triviaMatcher: m`#: :Comment: <
|
|
65
|
+
triviaMatcher: m`#: :Comment: <__Trivia /[ \n\r\t]|\/\/|\/\*/ />`
|
|
53
66
|
}, atrivialGrammar);
|
package/lib/es2018.macro.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CoveredBy, Node
|
|
3
|
-
import { o,
|
|
1
|
+
import { spam as m } from '@bablr/boot';
|
|
2
|
+
import { CoveredBy, Node } from '@bablr/helpers/decorators';
|
|
3
|
+
import { o, eat, eatMatch } from '@bablr/helpers/grammar';
|
|
4
4
|
import { triviaEnhancer } from '@bablr/helpers/trivia';
|
|
5
5
|
import * as Comment from '@bablr/language-en-c-comments';
|
|
6
6
|
import * as es2017 from './es2017.js';
|
|
7
7
|
|
|
8
8
|
export const dependencies = { Comment };
|
|
9
9
|
|
|
10
|
+
export const defaultMatcher = m`.+: <_Expression />`;
|
|
11
|
+
|
|
10
12
|
export {
|
|
11
13
|
powerLevels,
|
|
12
14
|
reservedWords,
|
|
@@ -28,10 +30,10 @@ export const atrivialGrammar = class ES2018Grammar extends es2017.atrivialGramma
|
|
|
28
30
|
*Object() {
|
|
29
31
|
yield eat(m`open: <*Punctuator '{' { balanced: '}' } />`);
|
|
30
32
|
yield eat(
|
|
31
|
-
m`properties[]$: <
|
|
33
|
+
m`properties[]$: <__List />`,
|
|
32
34
|
o({
|
|
33
|
-
element: m`<
|
|
34
|
-
separator: m
|
|
35
|
+
element: m`<_ObjectMember />`,
|
|
36
|
+
separator: m`#separatorTokens[]: <*Punctuator ',' />`,
|
|
35
37
|
allowTrailingSeparator: true,
|
|
36
38
|
}),
|
|
37
39
|
);
|
|
@@ -45,17 +47,34 @@ export const atrivialGrammar = class ES2018Grammar extends es2017.atrivialGramma
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
@Node
|
|
51
|
+
*ObjectPattern() {
|
|
52
|
+
yield eat(m`openToken: <*Punctuator '{' { balanced: '}' } />`);
|
|
53
|
+
yield eat(
|
|
54
|
+
m`params[]+$: <__List />`,
|
|
55
|
+
o({
|
|
56
|
+
element: m`<PropertyPattern />`,
|
|
57
|
+
allowTrailingSeparator: true,
|
|
58
|
+
separator: m`#separatorTokens[]: <*Punctuator ',' />`,
|
|
59
|
+
}),
|
|
60
|
+
);
|
|
61
|
+
if (yield eatMatch(m`params[]+$: <SpreadElement '...' />`)) {
|
|
62
|
+
yield eatMatch(m`#separatorTokens[]: <*Punctuator ',' />`);
|
|
63
|
+
}
|
|
64
|
+
yield eat(m`closeToken: <*Punctuator '}' { balancer: true } />`);
|
|
65
|
+
}
|
|
66
|
+
|
|
48
67
|
@Node
|
|
49
68
|
*SpreadElement() {
|
|
50
69
|
yield eat(m`sigilToken: <*Punctuator '...' />`);
|
|
51
|
-
yield eat(m`value+$: <
|
|
70
|
+
yield eat(m`value+$: <_Expression />`, o({ power: 32 }));
|
|
52
71
|
}
|
|
53
72
|
};
|
|
54
73
|
|
|
55
74
|
export const grammar = triviaEnhancer(
|
|
56
75
|
{
|
|
57
76
|
triviaIsAllowed: (s) => s.span === 'Bare',
|
|
58
|
-
triviaMatcher: m`#: :Comment: <
|
|
77
|
+
triviaMatcher: m`#: :Comment: <__Trivia /[ \n\r\t]|\/\/|\/\*/ />`,
|
|
59
78
|
},
|
|
60
79
|
atrivialGrammar,
|
|
61
80
|
);
|
package/lib/es2020.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* @macrome
|
|
2
2
|
* @generatedby @bablr/macrome-generator-bablr
|
|
3
|
-
* @generatedfrom ./es2020.macro.js#
|
|
3
|
+
* @generatedfrom ./es2020.macro.js#219556c33d9f9d0d57628a75f4098a53b669f2fb
|
|
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
|
*/
|
|
@@ -16,6 +16,7 @@ import * as es2019 from './es2019.js';
|
|
|
16
16
|
export const dependencies = {
|
|
17
17
|
Comment
|
|
18
18
|
};
|
|
19
|
+
export const defaultMatcher = m`.+: <_Expression />`;
|
|
19
20
|
export { powerLevels, reservedWords, assignmentOperators, assignmentOperatorAlternatives, unaryPrefixOperators, unaryPrefixOperatorAlternatives, unaryPostfixOperators, unaryPostfixOperatorAlternatives, getBinaryOperatorAlternatives } from './es2019.js';
|
|
20
21
|
export const canonicalURL = 'https://bablr.org/languages/universe/es6';
|
|
21
22
|
export const atrivialGrammar = class ES2020Grammar extends (_es2019$atrivialGramm = es2019.atrivialGrammar) {
|
|
@@ -47,7 +48,7 @@ export const atrivialGrammar = class ES2020Grammar extends (_es2019$atrivialGram
|
|
|
47
48
|
*MemberExpression({
|
|
48
49
|
ctx
|
|
49
50
|
}) {
|
|
50
|
-
yield eat(m`object+$: <
|
|
51
|
+
yield eat(m`object+$: <_Expression />`, o({
|
|
51
52
|
power: 2
|
|
52
53
|
}));
|
|
53
54
|
yield defineAttribute('power', 2);
|
|
@@ -59,10 +60,10 @@ export const atrivialGrammar = class ES2020Grammar extends (_es2019$atrivialGram
|
|
|
59
60
|
if (yield eatMatch(m`openToken: <*Punctuator '[' { balanced: ']' } />`, o({}), o({
|
|
60
61
|
bind: true
|
|
61
62
|
}))) {
|
|
62
|
-
yield eat(m`property+$: <
|
|
63
|
+
yield eat(m`property+$: <_Expression />`);
|
|
63
64
|
yield eat(m`closeToken: <*Punctuator ']' { balancer: true } />`);
|
|
64
65
|
} else {
|
|
65
|
-
yield eat(m`property+$: <
|
|
66
|
+
yield eat(m`property+$: <_Expression />`, o({
|
|
66
67
|
power: 2
|
|
67
68
|
}));
|
|
68
69
|
yield eat(m`closeToken: null`);
|
|
@@ -83,7 +84,7 @@ export const atrivialGrammar = class ES2020Grammar extends (_es2019$atrivialGram
|
|
|
83
84
|
{
|
|
84
85
|
yield eat(m`dotToken: null`);
|
|
85
86
|
yield eat(m`openToken: <*Punctuator '[' { balanced: ']' } />`);
|
|
86
|
-
yield eat(m`property+$: <
|
|
87
|
+
yield eat(m`property+$: <_Expression />`);
|
|
87
88
|
yield eat(m`closeToken: <*Punctuator ']' { balancer: true } />`);
|
|
88
89
|
break;
|
|
89
90
|
}
|
|
@@ -94,5 +95,5 @@ export const atrivialGrammar = class ES2020Grammar extends (_es2019$atrivialGram
|
|
|
94
95
|
};
|
|
95
96
|
export const grammar = triviaEnhancer({
|
|
96
97
|
triviaIsAllowed: s => s.span === 'Bare',
|
|
97
|
-
triviaMatcher: m`#: :Comment: <
|
|
98
|
+
triviaMatcher: m`#: :Comment: <__Trivia /[ \n\r\t]|\/\/|\/\*/ />`
|
|
98
99
|
}, atrivialGrammar);
|
package/lib/es2020.macro.js
CHANGED
|
@@ -7,6 +7,8 @@ import * as es2019 from './es2019.js';
|
|
|
7
7
|
|
|
8
8
|
export const dependencies = { Comment };
|
|
9
9
|
|
|
10
|
+
export const defaultMatcher = m`.+: <_Expression />`;
|
|
11
|
+
|
|
10
12
|
export {
|
|
11
13
|
powerLevels,
|
|
12
14
|
reservedWords,
|
|
@@ -42,7 +44,7 @@ export const atrivialGrammar = class ES2020Grammar extends es2019.atrivialGramma
|
|
|
42
44
|
@CoveredBy('LogicExpression')
|
|
43
45
|
@Node
|
|
44
46
|
*MemberExpression({ ctx }) {
|
|
45
|
-
yield eat(m`object+$: <
|
|
47
|
+
yield eat(m`object+$: <_Expression />`, o({ power: 2 }));
|
|
46
48
|
yield defineAttribute('power', 2);
|
|
47
49
|
|
|
48
50
|
let sigil = yield match(re`/\?\.|[[.]/`);
|
|
@@ -58,10 +60,10 @@ export const atrivialGrammar = class ES2020Grammar extends es2019.atrivialGramma
|
|
|
58
60
|
o({ bind: true }),
|
|
59
61
|
)
|
|
60
62
|
) {
|
|
61
|
-
yield eat(m`property+$: <
|
|
63
|
+
yield eat(m`property+$: <_Expression />`);
|
|
62
64
|
yield eat(m`closeToken: <*Punctuator ']' { balancer: true } />`);
|
|
63
65
|
} else {
|
|
64
|
-
yield eat(m`property+$: <
|
|
66
|
+
yield eat(m`property+$: <_Expression />`, o({ power: 2 }));
|
|
65
67
|
yield eat(m`closeToken: null`);
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -79,7 +81,7 @@ export const atrivialGrammar = class ES2020Grammar extends es2019.atrivialGramma
|
|
|
79
81
|
case '[': {
|
|
80
82
|
yield eat(m`dotToken: null`);
|
|
81
83
|
yield eat(m`openToken: <*Punctuator '[' { balanced: ']' } />`);
|
|
82
|
-
yield eat(m`property+$: <
|
|
84
|
+
yield eat(m`property+$: <_Expression />`);
|
|
83
85
|
yield eat(m`closeToken: <*Punctuator ']' { balancer: true } />`);
|
|
84
86
|
break;
|
|
85
87
|
}
|
|
@@ -93,7 +95,7 @@ export const atrivialGrammar = class ES2020Grammar extends es2019.atrivialGramma
|
|
|
93
95
|
export const grammar = triviaEnhancer(
|
|
94
96
|
{
|
|
95
97
|
triviaIsAllowed: (s) => s.span === 'Bare',
|
|
96
|
-
triviaMatcher: m`#: :Comment: <
|
|
98
|
+
triviaMatcher: m`#: :Comment: <__Trivia /[ \n\r\t]|\/\/|\/\*/ />`,
|
|
97
99
|
},
|
|
98
100
|
atrivialGrammar,
|
|
99
101
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-esnext",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A BABLR language tracking the most current approved EcmaScript specification",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@babel/runtime": "7.24.6",
|
|
26
|
-
"@bablr/agast-vm-helpers": "0.
|
|
27
|
-
"@bablr/boot": "0.
|
|
28
|
-
"@bablr/helpers": "0.
|
|
29
|
-
"@bablr/language-en-c-comments": "0.
|
|
30
|
-
"@bablr/language-en-es6": "0.
|
|
26
|
+
"@bablr/agast-vm-helpers": "0.9.0",
|
|
27
|
+
"@bablr/boot": "0.10.0",
|
|
28
|
+
"@bablr/helpers": "0.24.0",
|
|
29
|
+
"@bablr/language-en-c-comments": "0.9.0",
|
|
30
|
+
"@bablr/language-en-es6": "0.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@bablr/agast-helpers": "^0.
|
|
33
|
+
"@bablr/agast-helpers": "^0.9.0",
|
|
34
34
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|
|
35
35
|
"@bablr/macrome": "0.1.3",
|
|
36
36
|
"@bablr/macrome-generator-bablr": "0.3.2",
|
|
37
37
|
"@qnighy/dedent": "0.1.1",
|
|
38
|
-
"bablr": "0.
|
|
38
|
+
"bablr": "0.10.0",
|
|
39
39
|
"enhanced-resolve": "^5.12.0",
|
|
40
40
|
"eslint": "^7.32.0",
|
|
41
41
|
"eslint-import-resolver-enhanced-resolve": "^1.0.5",
|