@bablr/language-en-esnext 0.3.4 → 0.3.6
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 +20 -2
- package/package.json +4 -3
package/lib/es2018.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spam as m } from '@bablr/boot';
|
|
2
|
-
import { eat, eatMatch } from '@bablr/helpers/grammar';
|
|
2
|
+
import { eat, eatMatch, getInstrMatcher } from '@bablr/helpers/grammar';
|
|
3
3
|
import { triviaEnhancer } from '@bablr/helpers/trivia';
|
|
4
4
|
import Space from '@bablr/language-en-blank-space';
|
|
5
5
|
import Comment from '@bablr/language-en-c-comments';
|
|
@@ -7,11 +7,15 @@ import Regex from '@bablr/language-en-es6/regex';
|
|
|
7
7
|
import { List } from '@bablr/helpers/productions';
|
|
8
8
|
|
|
9
9
|
import es2017 from './es2017.js';
|
|
10
|
+
import { reifyMatcherReferenceName } from '@bablr/agast-vm-helpers';
|
|
11
|
+
import { Coroutine } from '@bablr/coroutine';
|
|
10
12
|
|
|
11
13
|
export const dependencies = { Comment, Space, Regex };
|
|
12
14
|
|
|
13
15
|
export const defaultMatcher = m`_+: <_Expression />`;
|
|
14
16
|
|
|
17
|
+
let runCo = (generator) => new Coroutine(generator).advance();
|
|
18
|
+
|
|
15
19
|
export {
|
|
16
20
|
powerLevels,
|
|
17
21
|
reservedWords,
|
|
@@ -30,7 +34,7 @@ const atrivial = class ES2018Grammar extends es2017.grammar.atrivial {
|
|
|
30
34
|
*Object() {
|
|
31
35
|
yield eat(m`openToken*: <* '{' />`);
|
|
32
36
|
yield* List({
|
|
33
|
-
element: m`properties[]
|
|
37
|
+
element: m`properties[]+: <_ObjectElement />`,
|
|
34
38
|
separator: m`#separatorTokens: <* ',' />`,
|
|
35
39
|
allowTrailingSeparator: true,
|
|
36
40
|
});
|
|
@@ -44,6 +48,20 @@ const atrivial = class ES2018Grammar extends es2017.grammar.atrivial {
|
|
|
44
48
|
}
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
*For(args) {
|
|
52
|
+
let co = runCo(super.For(args));
|
|
53
|
+
|
|
54
|
+
while (!co.done) {
|
|
55
|
+
let instr = co.value;
|
|
56
|
+
let refName = reifyMatcherReferenceName(getInstrMatcher(instr));
|
|
57
|
+
|
|
58
|
+
co.advance(yield instr);
|
|
59
|
+
if (refName === 'sigilToken') {
|
|
60
|
+
yield eatMatch(m`awaitToken: <*Keyword 'await' />`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
47
65
|
*ObjectPattern() {
|
|
48
66
|
yield eat(m`openToken*: <* '{' />`);
|
|
49
67
|
yield* List({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-esnext",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "A BABLR language tracking the most current approved EcmaScript specification",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
"@bablr/agast-helpers": "0.10.4",
|
|
23
23
|
"@bablr/agast-vm-helpers": "0.10.4",
|
|
24
24
|
"@bablr/boot": "0.11.3",
|
|
25
|
-
"@bablr/
|
|
25
|
+
"@bablr/coroutine": "0.1.0",
|
|
26
|
+
"@bablr/helpers": "0.25.3",
|
|
26
27
|
"@bablr/language-en-blank-space": "0.10.12",
|
|
27
28
|
"@bablr/language-en-c-comments": "0.10.2",
|
|
28
|
-
"@bablr/language-en-es6": "0.3.
|
|
29
|
+
"@bablr/language-en-es6": "0.3.6"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#49f5952efed27f94ee9b94340eb1563c440bf64e",
|