mambascript 0.5.4 → 2.0.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +326 -0
  2. package/README.md +509 -267
  3. package/bin/mamba +1 -258
  4. package/decision.js +1 -246
  5. package/docs/coverage.md +70 -0
  6. package/docs/features.md +3348 -0
  7. package/docs/perf.md +94 -0
  8. package/docs/reference.md +1295 -0
  9. package/docs/vs-coffeescript.md +1593 -0
  10. package/docs/vs-iced-coffeescript.md +626 -0
  11. package/docs/vs-typescript.md +107 -0
  12. package/esm.js +8 -0
  13. package/jest.js +33 -0
  14. package/lib/black.js +17 -13
  15. package/lib/browser.js +2 -4
  16. package/lib/cli.js +207 -136
  17. package/lib/compiler.js +1162 -93
  18. package/lib/decision.js +10 -10
  19. package/lib/diagnostics.js +219 -0
  20. package/lib/esm-hooks.js +60 -0
  21. package/lib/fast-parser.js +3469 -0
  22. package/lib/functional-helpers.js +26 -9
  23. package/lib/helpers.js +67 -50
  24. package/lib/js-nodes.js +151 -12
  25. package/lib/lexer.js +1499 -0
  26. package/lib/light-module.js +200 -63
  27. package/lib/mamba.js +372 -0
  28. package/lib/module.js +23 -172
  29. package/lib/nodes.js +84 -21
  30. package/lib/optimiser.js +29 -9
  31. package/lib/optparse.js +32 -15
  32. package/lib/parser.js +9433 -4840
  33. package/lib/preprocessor.js +3 -5
  34. package/lib/register.js +49 -56
  35. package/lib/repl.js +28 -9
  36. package/lib/reporter.js +106 -69
  37. package/lib/run.js +3 -5
  38. package/lib/string-scanner.js +94 -0
  39. package/lib/syntax-tables.js +480 -0
  40. package/lib/type-checker.js +258 -44
  41. package/lib/type-helpers.js +28 -10
  42. package/lib/type-resolver.js +256 -34
  43. package/lib/type-scope.js +10 -6
  44. package/lib/type-walker.js +664 -85
  45. package/lib/types.js +17 -7
  46. package/lib/underscore.js +170 -76
  47. package/lib/unicode-classes.js +122 -0
  48. package/mambaview.js +1 -0
  49. package/package.json +49 -46
  50. package/stdlib.js +1 -0
  51. package/vendor/README.md +40 -0
  52. package/vendor/escodegen/LICENSE.BSD +19 -0
  53. package/vendor/escodegen/escodegen.js +2289 -0
  54. package/vendor/estraverse/LICENSE.BSD +19 -0
  55. package/vendor/estraverse/estraverse.js +706 -0
  56. package/vendor/mambacodegen/LICENSE +24 -0
  57. package/vendor/mambacodegen/lib/mscodegen.js +620 -0
  58. package/vendor/patches/escodegen.diff +130 -0
  59. package/vendor/patches/estraverse.diff +51 -0
  60. package/vendor/patches/pegjs.diff +70 -0
  61. package/vendor/patches/source-map.diff +160 -0
  62. package/vendor/source-map/LICENSE +28 -0
  63. package/vendor/source-map/lib/source-map/array-set.js +92 -0
  64. package/vendor/source-map/lib/source-map/base64-vlq.js +140 -0
  65. package/vendor/source-map/lib/source-map/base64.js +38 -0
  66. package/vendor/source-map/lib/source-map/binary-search.js +77 -0
  67. package/vendor/source-map/lib/source-map/source-map-consumer.js +404 -0
  68. package/vendor/source-map/lib/source-map/source-map-generator.js +229 -0
  69. package/vendor/source-map/lib/source-map/source-node.js +201 -0
  70. package/vendor/source-map/lib/source-map/util.js +57 -0
  71. package/vendor/source-map/lib/source-map.js +8 -0
  72. package/bin/fix +0 -17
  73. package/bin/updateImports +0 -46
  74. package/build.js +0 -25
  75. package/lib/module-esm.js +0 -901
  76. package/lib/pegjs-kofu-plugin.js +0 -35
  77. package/lib/pegjs-mamba-plugin.js +0 -35
  78. package/lib/processor-esm.js +0 -507
  79. package/mamba +0 -259
  80. package/msast.js +0 -1
  81. package/utils/gulp-mamba.js +0 -29
  82. /package/{lib/esm.js → vendor/patches/mambacodegen.diff} +0 -0
@@ -1,6 +1,4 @@
1
- // Generated by MambaScript 0.5.2
2
- var present = console.log;
3
- // Generated by MambaScript 0.5.2
1
+ // Generated by MambaScript 2.0.0
4
2
  var concat, foldl, map, nub, span;
5
3
  this.any = function (list, fn) {
6
4
  var e;
@@ -52,7 +50,7 @@ this.map = map = function (list, fn) {
52
50
  };
53
51
  this.concat = concat = function (list) {
54
52
  var cache$;
55
- return (cache$ = []).concat.apply(cache$, [].slice.call(list));
53
+ return (cache$ = []).concat.apply(cache$, Array.from(list));
56
54
  };
57
55
  this.concatMap = function (list, fn) {
58
56
  return concat(map(list, fn));
@@ -74,7 +72,7 @@ this.difference = function (listA, listB) {
74
72
  return function (accum$) {
75
73
  for (var i$ = 0, length$ = listA.length; i$ < length$; ++i$) {
76
74
  a = listA[i$];
77
- if (!!in$(a, listB))
75
+ if (in$(a, listB))
78
76
  continue;
79
77
  accum$.push(a);
80
78
  }
@@ -86,7 +84,7 @@ this.nub = nub = function (list) {
86
84
  result = [];
87
85
  for (var i$ = 0, length$ = list.length; i$ < length$; ++i$) {
88
86
  i = list[i$];
89
- if (!!in$(i, result))
87
+ if (in$(i, result))
90
88
  continue;
91
89
  result.push(i);
92
90
  }
@@ -97,13 +95,32 @@ this.union = function (listA, listB) {
97
95
  return listA.concat(function (accum$) {
98
96
  for (var cache$ = nub(listB), i$ = 0, length$ = cache$.length; i$ < length$; ++i$) {
99
97
  b = cache$[i$];
100
- if (!!in$(b, listA))
98
+ if (in$(b, listA))
101
99
  continue;
102
100
  accum$.push(b);
103
101
  }
104
102
  return accum$;
105
103
  }.call(this, []));
106
104
  };
105
+ this.extendScope = function (listA, listB) {
106
+ var added, b;
107
+ if (!listB.length)
108
+ return listA;
109
+ added = function (accum$) {
110
+ for (var cache$ = nub(listB), i$ = 0, length$ = cache$.length; i$ < length$; ++i$) {
111
+ b = cache$[i$];
112
+ if (in$(b, listA))
113
+ continue;
114
+ accum$.push(b);
115
+ }
116
+ return accum$;
117
+ }.call(this, []);
118
+ if (added.length) {
119
+ return listA.concat(added);
120
+ } else {
121
+ return listA;
122
+ }
123
+ };
107
124
  this.flip = function (fn) {
108
125
  return function (b, a) {
109
126
  return fn.call(this, a, b);
@@ -126,7 +143,7 @@ this.span = span = function (list, f) {
126
143
  ys = cache$[0];
127
144
  zs = cache$[1];
128
145
  return [
129
- [list[0]].concat([].slice.call(ys)),
146
+ [list[0]].concat(Array.from(ys)),
130
147
  zs
131
148
  ];
132
149
  } else {
@@ -169,4 +186,4 @@ function in$(member, list) {
169
186
  if (i in list && list[i] === member)
170
187
  return true;
171
188
  return false;
172
- }
189
+ }
package/lib/helpers.js CHANGED
@@ -1,7 +1,5 @@
1
- // Generated by MambaScript 0.5.2
2
- var present = console.log;
3
- // Generated by MambaScript 0.5.2
4
- var beingDeclared, cleanMarkers, colourise, COLOURS, concat, concatMap, CS, difference, envEnrichments, envEnrichments_, foldl, humanReadable, map, nub, numberLines, pointToErrorLocation, SUPPORTS_COLOUR, usedAsExpression, usedAsExpression_;
1
+ // Generated by MambaScript 2.0.0
2
+ var beingDeclared, cache$, cleanMarkers, colourise, COLOURS, concat, concatMap, CS, difference, envEnrichments, envEnrichments_, envPossibilities, foldl, humanReadable, map, nub, numberLines, pointToErrorLocation, possibilitiesOf, SUPPORTS_COLOUR, usedAsExpression, usedAsExpression_;
5
3
  cache$ = require('./functional-helpers');
6
4
  concat = cache$.concat;
7
5
  concatMap = cache$.concatMap;
@@ -16,12 +14,13 @@ COLOURS = {
16
14
  yellow: '\x1b[33m',
17
15
  blue: '\x1b[34m',
18
16
  magenta: '\x1b[35m',
19
- cyan: '\x1b[36m'
17
+ cyan: '\x1b[36m',
18
+ bold: '\x1b[1m'
20
19
  };
21
20
  SUPPORTS_COLOUR = ('undefined' !== typeof process && null != process && null != process.stderr ? process.stderr.isTTY : void 0) && !process.env.NODE_DISABLE_COLORS;
22
- colourise = function (colour, str) {
21
+ this.colourise = colourise = function (colour, str) {
23
22
  if (SUPPORTS_COLOUR) {
24
- return '' + COLOURS[colour] + str + '\x1b[39m';
23
+ return '' + COLOURS[colour] + str + (colour === 'bold' ? '\x1b[22m' : '\x1b[39m');
25
24
  } else {
26
25
  return str;
27
26
  }
@@ -44,7 +43,7 @@ this.numberLines = numberLines = function (input, startLine) {
44
43
  }.call(this, []);
45
44
  return numbered.join('\n');
46
45
  };
47
- cleanMarkers = function (str) {
46
+ this.cleanMarkers = cleanMarkers = function (str) {
48
47
  return str.replace(/[\uEFEF\uEFFE\uEFFF]/g, '');
49
48
  };
50
49
  this.humanReadable = humanReadable = function (str) {
@@ -62,6 +61,12 @@ this.formatParserError = function (input, e) {
62
61
  message = 'Syntax error on line ' + e.line + ', column ' + realColumn + ": unexpected '" + found + "' with the unicode value of (" + unicode + '). Below you should be able to see where the error is contained, keep in mind this error normally comes from you not being mindful of your indentation, or ending lines with operators. You have to maintain the same consistent indentation throughout your program. If you think that you found a bug in the language this error is generated from src/helpers.mamba help me improve it';
63
62
  return '' + message + '\n' + pointToErrorLocation(input, e.line, realColumn);
64
63
  };
64
+ this.formatSyntaxError = function (input, e) {
65
+ return 'Syntax error on line ' + e.line + ', column ' + e.column + ': ' + e.message + '\n' + pointToErrorLocation(input, e.line, e.column);
66
+ };
67
+ this.literateToCode = function (input) {
68
+ return input.replace(/^( {0,3}\S)/gm, ' #$1');
69
+ };
65
70
  this.pointToErrorLocation = pointToErrorLocation = function (source, line, column, numLinesOfContext) {
66
71
  var currentLineOffset, lines, numberedLines, padSize, postLines, preLines, startLine;
67
72
  if (null == numLinesOfContext)
@@ -76,12 +81,12 @@ this.pointToErrorLocation = pointToErrorLocation = function (source, line, colum
76
81
  preLines = lines.slice(startLine, +currentLineOffset + 1 || 9e9);
77
82
  preLines[preLines.length - 1] = colourise('yellow', preLines[preLines.length - 1]);
78
83
  postLines = lines.slice(currentLineOffset + 1, +(currentLineOffset + numLinesOfContext) + 1 || 9e9);
79
- numberedLines = numberLines(cleanMarkers([].slice.call(preLines).concat([].slice.call(postLines)).join('\n')), startLine + 1).split('\n');
84
+ numberedLines = numberLines(cleanMarkers(Array.from(preLines).concat(Array.from(postLines)).join('\n')), startLine + 1).split('\n');
80
85
  preLines = numberedLines.slice(0, preLines.length);
81
86
  postLines = numberedLines.slice(preLines.length);
82
87
  column = cleanMarkers(('' + lines[currentLineOffset] + '\n').slice(0, column)).length;
83
88
  padSize = (currentLineOffset + 1 + postLines.length).toString(10).length;
84
- return [].slice.call(preLines).concat(['' + colourise('red', Array(padSize + 1).join('^')) + ' : ' + Array(column).join(' ') + colourise('red', '^')], [].slice.call(postLines)).join('\n');
89
+ return Array.from(preLines).concat(['' + colourise('red', Array(padSize + 1).join('^')) + ' : ' + Array(column).join(' ') + colourise('red', '^')], Array.from(postLines)).join('\n');
85
90
  };
86
91
  this.beingDeclared = beingDeclared = function (assignment) {
87
92
  switch (false) {
@@ -132,55 +137,63 @@ usedAsExpression_ = function (ancestors) {
132
137
  this.usedAsExpression = usedAsExpression = function (node, ancestors) {
133
138
  return usedAsExpression_.call(node, ancestors);
134
139
  };
135
- envEnrichments_ = function (inScope) {
136
- var possibilities;
137
- if (null == inScope)
138
- inScope = [];
139
- possibilities = nub(function () {
140
+ envPossibilities = new WeakMap;
141
+ possibilitiesOf = function (node) {
142
+ var cached, result;
143
+ if (!(null != node))
144
+ return [];
145
+ cached = envPossibilities.get(node);
146
+ if (null != cached)
147
+ return cached;
148
+ result = nub(function () {
140
149
  switch (false) {
141
- case !this['instanceof'](CS.AssignOp):
150
+ case !node['instanceof'](CS.AssignOp):
142
151
  return concat([
143
- beingDeclared(this.assignee),
144
- envEnrichments(this.expression)
152
+ beingDeclared(node.assignee),
153
+ possibilitiesOf(node.expression)
145
154
  ]);
146
- case !this['instanceof'](CS.Class):
155
+ case !node['instanceof'](CS.Class):
147
156
  return concat([
148
- beingDeclared(this.nameAssignee),
149
- envEnrichments(this.parent)
157
+ beingDeclared(node.nameAssignee),
158
+ possibilitiesOf(node.parent)
150
159
  ]);
151
- case !this['instanceof'](CS.ForIn, CS.ForOf):
160
+ case !node['instanceof'](CS.Grab, CS.Share):
161
+ return possibilitiesOf(node.cjs);
162
+ case !node['instanceof'](CS.ForIn, CS.ForOf, CS.ForFrom):
152
163
  return concat([
153
- beingDeclared(this.keyAssignee),
154
- beingDeclared(this.valAssignee),
155
- envEnrichments(this.target),
156
- envEnrichments(this.step),
157
- envEnrichments(this.filter),
158
- envEnrichments(this.body)
164
+ beingDeclared(node.keyAssignee),
165
+ beingDeclared(node.valAssignee),
166
+ possibilitiesOf(node.target),
167
+ possibilitiesOf(node.step),
168
+ possibilitiesOf(node.filter),
169
+ possibilitiesOf(node.body)
159
170
  ]);
160
- case !this['instanceof'](CS.Try):
171
+ case !node['instanceof'](CS.Try):
161
172
  return concat([
162
- beingDeclared(this.catchAssignee),
163
- envEnrichments(this.body),
164
- envEnrichments(this.catchBody),
165
- envEnrichments(this.finallyBody)
173
+ beingDeclared(node.catchAssignee),
174
+ possibilitiesOf(node.body),
175
+ possibilitiesOf(node.catchBody),
176
+ possibilitiesOf(node.finallyBody)
166
177
  ]);
167
- case !this['instanceof'](CS.Functions):
178
+ case !node['instanceof'](CS.Functions):
168
179
  return [];
169
180
  default:
170
- return concatMap(this.childNodes, function (this$) {
171
- return function (child) {
172
- if (in$(child, this$.listMembers)) {
173
- return concatMap(this$[child], function (m) {
174
- return envEnrichments(m, inScope);
175
- });
176
- } else {
177
- return envEnrichments(this$[child], inScope);
178
- }
179
- };
180
- }(this));
181
+ return concatMap(node.childNodes, function (child) {
182
+ if (in$(child, node.listMembers)) {
183
+ return concatMap(node[child], possibilitiesOf);
184
+ } else {
185
+ return possibilitiesOf(node[child]);
186
+ }
187
+ });
181
188
  }
182
189
  }.call(this));
183
- return difference(possibilities, inScope);
190
+ envPossibilities.set(node, result);
191
+ return result;
192
+ };
193
+ envEnrichments_ = function (inScope) {
194
+ if (null == inScope)
195
+ inScope = [];
196
+ return difference(possibilitiesOf(this), inScope);
184
197
  };
185
198
  this.envEnrichments = envEnrichments = function (node) {
186
199
  var args;
@@ -192,12 +205,16 @@ this.envEnrichments = envEnrichments = function (node) {
192
205
  }
193
206
  };
194
207
  this.debug = function (flag) {
195
- var args, argv, i, util;
208
+ var args, argv, debugFlag, i, idx, util;
196
209
  args = arguments.length > 1 ? [].slice.call(arguments, 1) : [];
197
210
  util = require('util');
198
- argv = require('kofu-optimist').alias('d', 'debug').argv;
211
+ argv = process.argv;
212
+ idx = Math.max(argv.indexOf('--debug'), argv.indexOf('-d'));
213
+ debugFlag = idx === -1 ? false : null != argv[idx + 1] ? argv[idx + 1] : true;
214
+ if (debugFlag === true || typeof debugFlag === 'string' && debugFlag[0] === '-')
215
+ debugFlag = true;
199
216
  if (arguments.length > 1) {
200
- if (!argv.debug || flag === argv.debug) {
217
+ if (debugFlag === true || flag === debugFlag) {
201
218
  return function (accum$) {
202
219
  for (var i$ = 0, length$ = args.length; i$ < length$; ++i$) {
203
220
  i = args[i$];
@@ -217,4 +234,4 @@ function in$(member, list) {
217
234
  if (i in list && list[i] === member)
218
235
  return true;
219
236
  return false;
220
- }
237
+ }
package/lib/js-nodes.js CHANGED
@@ -1,7 +1,5 @@
1
- // Generated by MambaScript 0.5.2
2
- var present = console.log;
3
- // Generated by MambaScript 0.5.2
4
- var ArrayExpression, AssignmentExpression, BinaryExpression, BlockStatement, CallExpression, createNode, ctor, difference, exports, FunctionDeclaration, FunctionExpression, GenSym, handleLists, handlePrimitives, Identifier, isStatement, Literal, LogicalExpression, MemberExpression, NewExpression, node, nodeData, Nodes, ObjectExpression, params, Program, SequenceExpression, SwitchCase, SwitchStatement, TryStatement, UnaryExpression, UpdateExpression, VariableDeclaration, VariableDeclaration;
1
+ // Generated by MambaScript 2.0.0
2
+ var ArrayExpression, AssignmentExpression, BigIntLiteral, BinaryExpression, BlockStatement, cache$, cache$1, CallExpression, createNode, ctor, difference, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, exports, ExportSpecifier, ForOfStatement, FunctionDeclaration, FunctionExpression, GenSym, handleLists, handlePrimitives, Identifier, ImportDeclaration, ImportDefaultSpecifier, ImportExpression, ImportNamespaceSpecifier, ImportSpecifier, isStatement, Literal, LogicalExpression, MemberExpression, NewExpression, node, nodeData, Nodes, ObjectExpression, params, Program, SequenceExpression, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateElement, TemplateLiteral, TryStatement, UnaryExpression, UpdateExpression, VariableDeclaration, YieldExpression;
5
3
  difference = require('./functional-helpers').difference;
6
4
  exports = null != ('undefined' !== typeof module && null != module ? module.exports : void 0) ? 'undefined' !== typeof module && null != module ? module.exports : void 0 : this;
7
5
  createNode = function (type, props) {
@@ -25,13 +23,13 @@ this.Nodes = Nodes = function () {
25
23
  }
26
24
  Nodes.prototype.listMembers = [];
27
25
  Nodes.prototype['instanceof'] = function () {
28
- var ctor, ctors;
29
- ctors = arguments.length > 0 ? [].slice.call(arguments, 0) : [];
30
- for (var i$ = 0, length$ = ctors.length; i$ < length$; ++i$) {
31
- ctor = ctors[i$];
32
- if (!(this.type === ctor.prototype.type))
33
- continue;
34
- return true;
26
+ var i, n;
27
+ n = arguments.length;
28
+ i = 0;
29
+ while (i < n) {
30
+ if (this.type === arguments[i].prototype.type)
31
+ return true;
32
+ i++;
35
33
  }
36
34
  return false;
37
35
  };
@@ -87,6 +85,11 @@ nodeData = [
87
85
  'right'
88
86
  ]
89
87
  ],
88
+ [
89
+ 'AwaitExpression',
90
+ false,
91
+ ['argument']
92
+ ],
90
93
  [
91
94
  'BinaryExpression',
92
95
  false,
@@ -168,6 +171,42 @@ nodeData = [
168
171
  'body'
169
172
  ]
170
173
  ],
174
+ [
175
+ 'ImportDeclaration',
176
+ true,
177
+ [
178
+ 'specifiers',
179
+ 'source'
180
+ ]
181
+ ],
182
+ [
183
+ 'ExportNamedDeclaration',
184
+ true,
185
+ [
186
+ 'declaration',
187
+ 'specifiers',
188
+ 'source'
189
+ ]
190
+ ],
191
+ [
192
+ 'ExportDefaultDeclaration',
193
+ true,
194
+ ['declaration']
195
+ ],
196
+ [
197
+ 'ExportAllDeclaration',
198
+ true,
199
+ ['source']
200
+ ],
201
+ [
202
+ 'ForOfStatement',
203
+ true,
204
+ [
205
+ 'left',
206
+ 'right',
207
+ 'body'
208
+ ]
209
+ ],
171
210
  [
172
211
  'ForStatement',
173
212
  true,
@@ -231,6 +270,11 @@ nodeData = [
231
270
  false,
232
271
  ['value']
233
272
  ],
273
+ [
274
+ 'BigIntLiteral',
275
+ false,
276
+ ['digits']
277
+ ],
234
278
  [
235
279
  'LogicalExpression',
236
280
  false,
@@ -328,6 +372,63 @@ nodeData = [
328
372
  'argument'
329
373
  ]
330
374
  ],
375
+ [
376
+ 'YieldExpression',
377
+ false,
378
+ ['argument']
379
+ ],
380
+ [
381
+ 'ImportSpecifier',
382
+ false,
383
+ [
384
+ 'imported',
385
+ 'local'
386
+ ]
387
+ ],
388
+ [
389
+ 'ImportDefaultSpecifier',
390
+ false,
391
+ ['local']
392
+ ],
393
+ [
394
+ 'ImportNamespaceSpecifier',
395
+ false,
396
+ ['local']
397
+ ],
398
+ [
399
+ 'ExportSpecifier',
400
+ false,
401
+ [
402
+ 'local',
403
+ 'exported'
404
+ ]
405
+ ],
406
+ [
407
+ 'ImportExpression',
408
+ false,
409
+ ['source']
410
+ ],
411
+ [
412
+ 'TaggedTemplateExpression',
413
+ false,
414
+ [
415
+ 'tag',
416
+ 'quasi'
417
+ ]
418
+ ],
419
+ [
420
+ 'TemplateLiteral',
421
+ false,
422
+ [
423
+ 'quasis',
424
+ 'expressions'
425
+ ]
426
+ ],
427
+ [
428
+ 'TemplateElement',
429
+ false,
430
+ []
431
+ ],
331
432
  [
332
433
  'UpdateExpression',
333
434
  false,
@@ -385,7 +486,22 @@ cache$1 = exports;
385
486
  Program = cache$1.Program;
386
487
  BlockStatement = cache$1.BlockStatement;
387
488
  Literal = cache$1.Literal;
489
+ BigIntLiteral = cache$1.BigIntLiteral;
388
490
  Identifier = cache$1.Identifier;
491
+ YieldExpression = cache$1.YieldExpression;
492
+ ForOfStatement = cache$1.ForOfStatement;
493
+ TaggedTemplateExpression = cache$1.TaggedTemplateExpression;
494
+ TemplateLiteral = cache$1.TemplateLiteral;
495
+ TemplateElement = cache$1.TemplateElement;
496
+ ImportDeclaration = cache$1.ImportDeclaration;
497
+ ImportSpecifier = cache$1.ImportSpecifier;
498
+ ImportDefaultSpecifier = cache$1.ImportDefaultSpecifier;
499
+ ImportNamespaceSpecifier = cache$1.ImportNamespaceSpecifier;
500
+ ExportNamedDeclaration = cache$1.ExportNamedDeclaration;
501
+ ExportSpecifier = cache$1.ExportSpecifier;
502
+ ExportDefaultDeclaration = cache$1.ExportDefaultDeclaration;
503
+ ExportAllDeclaration = cache$1.ExportAllDeclaration;
504
+ ImportExpression = cache$1.ImportExpression;
389
505
  FunctionExpression = cache$1.FunctionExpression;
390
506
  CallExpression = cache$1.CallExpression;
391
507
  SequenceExpression = cache$1.SequenceExpression;
@@ -426,6 +542,7 @@ handlePrimitives(GenSym, [
426
542
  ]);
427
543
  handlePrimitives(Identifier, ['name']);
428
544
  handlePrimitives(Literal, ['value']);
545
+ handlePrimitives(BigIntLiteral, ['digits']);
429
546
  handlePrimitives(MemberExpression, ['computed']);
430
547
  handlePrimitives(UnaryExpression, ['operator']);
431
548
  handlePrimitives(UpdateExpression, [
@@ -433,10 +550,31 @@ handlePrimitives(UpdateExpression, [
433
550
  'prefix'
434
551
  ]);
435
552
  handlePrimitives(VariableDeclaration, ['kind']);
553
+ handlePrimitives(FunctionDeclaration, [
554
+ 'async',
555
+ 'generator'
556
+ ]);
557
+ handlePrimitives(FunctionExpression, [
558
+ 'async',
559
+ 'generator'
560
+ ]);
561
+ handlePrimitives(YieldExpression, ['delegate']);
562
+ handlePrimitives(Program, ['esm']);
563
+ handlePrimitives(TemplateElement, [
564
+ 'value',
565
+ 'tail'
566
+ ]);
567
+ handlePrimitives(ForOfStatement, ['await']);
436
568
  handleLists = function (ctor, listProps) {
437
569
  return ctor.prototype.listMembers = listProps;
438
570
  };
439
571
  handleLists(ArrayExpression, ['elements']);
572
+ handleLists(ImportDeclaration, ['specifiers']);
573
+ handleLists(ExportNamedDeclaration, ['specifiers']);
574
+ handleLists(TemplateLiteral, [
575
+ 'quasis',
576
+ 'expressions'
577
+ ]);
440
578
  handleLists(BlockStatement, ['body']);
441
579
  handleLists(CallExpression, ['arguments']);
442
580
  handleLists(FunctionDeclaration, ['params']);
@@ -450,6 +588,7 @@ handleLists(SwitchStatement, ['cases']);
450
588
  handleLists(TryStatement, ['handlers']);
451
589
  handleLists(VariableDeclaration, ['declarations']);
452
590
  FunctionDeclaration.prototype.generated = FunctionExpression.prototype.generated = false;
591
+ FunctionDeclaration.prototype.async = FunctionExpression.prototype.async = false;
453
592
  FunctionDeclaration.prototype.g = FunctionExpression.prototype.g = function () {
454
593
  this.generated = true;
455
594
  return this;
@@ -474,4 +613,4 @@ function in$(member, list) {
474
613
  if (i in list && list[i] === member)
475
614
  return true;
476
615
  return false;
477
- }
616
+ }