build
This commit is contained in:
parent
e783de3453
commit
b0e50db4f6
43 changed files with 28084 additions and 227 deletions
1090
docs/_snowpack/pkg/common/index-1e63141f.js
Normal file
1090
docs/_snowpack/pkg/common/index-1e63141f.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,93 +1,5 @@
|
|||
import { c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js';
|
||||
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
/* eslint-disable no-unused-vars */
|
||||
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
function toObject(val) {
|
||||
if (val === null || val === undefined) {
|
||||
throw new TypeError('Object.assign cannot be called with null or undefined');
|
||||
}
|
||||
|
||||
return Object(val);
|
||||
}
|
||||
|
||||
function shouldUseNative() {
|
||||
try {
|
||||
if (!Object.assign) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detect buggy property enumeration order in older V8 versions.
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
||||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
||||
test1[5] = 'de';
|
||||
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||||
var test2 = {};
|
||||
for (var i = 0; i < 10; i++) {
|
||||
test2['_' + String.fromCharCode(i)] = i;
|
||||
}
|
||||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
||||
return test2[n];
|
||||
});
|
||||
if (order2.join('') !== '0123456789') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||||
var test3 = {};
|
||||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
||||
test3[letter] = letter;
|
||||
});
|
||||
if (Object.keys(Object.assign({}, test3)).join('') !==
|
||||
'abcdefghijklmnopqrst') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
// We don't expect any of the above to throw, but better to be safe.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
||||
var from;
|
||||
var to = toObject(target);
|
||||
var symbols;
|
||||
|
||||
for (var s = 1; s < arguments.length; s++) {
|
||||
from = Object(arguments[s]);
|
||||
|
||||
for (var key in from) {
|
||||
if (hasOwnProperty.call(from, key)) {
|
||||
to[key] = from[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (getOwnPropertySymbols) {
|
||||
symbols = getOwnPropertySymbols(from);
|
||||
for (var i = 0; i < symbols.length; i++) {
|
||||
if (propIsEnumerable.call(from, symbols[i])) {
|
||||
to[symbols[i]] = from[symbols[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
};
|
||||
import { o as objectAssign } from './index-d01087d6.js';
|
||||
|
||||
var react_production_min = createCommonjsModule(function (module, exports) {
|
||||
var n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;
|
||||
|
|
@ -114,4 +26,4 @@ var react = createCommonjsModule(function (module) {
|
|||
}
|
||||
});
|
||||
|
||||
export { objectAssign as o, react as r };
|
||||
export { react as r };
|
||||
90
docs/_snowpack/pkg/common/index-d01087d6.js
Normal file
90
docs/_snowpack/pkg/common/index-d01087d6.js
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
/* eslint-disable no-unused-vars */
|
||||
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
function toObject(val) {
|
||||
if (val === null || val === undefined) {
|
||||
throw new TypeError('Object.assign cannot be called with null or undefined');
|
||||
}
|
||||
|
||||
return Object(val);
|
||||
}
|
||||
|
||||
function shouldUseNative() {
|
||||
try {
|
||||
if (!Object.assign) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detect buggy property enumeration order in older V8 versions.
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
||||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
||||
test1[5] = 'de';
|
||||
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||||
var test2 = {};
|
||||
for (var i = 0; i < 10; i++) {
|
||||
test2['_' + String.fromCharCode(i)] = i;
|
||||
}
|
||||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
||||
return test2[n];
|
||||
});
|
||||
if (order2.join('') !== '0123456789') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||||
var test3 = {};
|
||||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
||||
test3[letter] = letter;
|
||||
});
|
||||
if (Object.keys(Object.assign({}, test3)).join('') !==
|
||||
'abcdefghijklmnopqrst') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
// We don't expect any of the above to throw, but better to be safe.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
||||
var from;
|
||||
var to = toObject(target);
|
||||
var symbols;
|
||||
|
||||
for (var s = 1; s < arguments.length; s++) {
|
||||
from = Object(arguments[s]);
|
||||
|
||||
for (var key in from) {
|
||||
if (hasOwnProperty.call(from, key)) {
|
||||
to[key] = from[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (getOwnPropertySymbols) {
|
||||
symbols = getOwnPropertySymbols(from);
|
||||
for (var i = 0; i < symbols.length; i++) {
|
||||
if (propIsEnumerable.call(from, symbols[i])) {
|
||||
to[symbols[i]] = from[symbols[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
};
|
||||
|
||||
export { objectAssign as o };
|
||||
810
docs/_snowpack/pkg/estraverse.js
Normal file
810
docs/_snowpack/pkg/estraverse.js
Normal file
|
|
@ -0,0 +1,810 @@
|
|||
import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js';
|
||||
|
||||
var estraverse = createCommonjsModule(function (module, exports) {
|
||||
/*
|
||||
Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*jslint vars:false, bitwise:true*/
|
||||
/*jshint indent:4*/
|
||||
/*global exports:true*/
|
||||
(function clone(exports) {
|
||||
|
||||
var Syntax,
|
||||
VisitorOption,
|
||||
VisitorKeys,
|
||||
BREAK,
|
||||
SKIP,
|
||||
REMOVE;
|
||||
|
||||
function deepCopy(obj) {
|
||||
var ret = {}, key, val;
|
||||
for (key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
val = obj[key];
|
||||
if (typeof val === 'object' && val !== null) {
|
||||
ret[key] = deepCopy(val);
|
||||
} else {
|
||||
ret[key] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// based on LLVM libc++ upper_bound / lower_bound
|
||||
// MIT License
|
||||
|
||||
function upperBound(array, func) {
|
||||
var diff, len, i, current;
|
||||
|
||||
len = array.length;
|
||||
i = 0;
|
||||
|
||||
while (len) {
|
||||
diff = len >>> 1;
|
||||
current = i + diff;
|
||||
if (func(array[current])) {
|
||||
len = diff;
|
||||
} else {
|
||||
i = current + 1;
|
||||
len -= diff + 1;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
Syntax = {
|
||||
AssignmentExpression: 'AssignmentExpression',
|
||||
AssignmentPattern: 'AssignmentPattern',
|
||||
ArrayExpression: 'ArrayExpression',
|
||||
ArrayPattern: 'ArrayPattern',
|
||||
ArrowFunctionExpression: 'ArrowFunctionExpression',
|
||||
AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
|
||||
BlockStatement: 'BlockStatement',
|
||||
BinaryExpression: 'BinaryExpression',
|
||||
BreakStatement: 'BreakStatement',
|
||||
CallExpression: 'CallExpression',
|
||||
CatchClause: 'CatchClause',
|
||||
ChainExpression: 'ChainExpression',
|
||||
ClassBody: 'ClassBody',
|
||||
ClassDeclaration: 'ClassDeclaration',
|
||||
ClassExpression: 'ClassExpression',
|
||||
ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.
|
||||
ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.
|
||||
ConditionalExpression: 'ConditionalExpression',
|
||||
ContinueStatement: 'ContinueStatement',
|
||||
DebuggerStatement: 'DebuggerStatement',
|
||||
DirectiveStatement: 'DirectiveStatement',
|
||||
DoWhileStatement: 'DoWhileStatement',
|
||||
EmptyStatement: 'EmptyStatement',
|
||||
ExportAllDeclaration: 'ExportAllDeclaration',
|
||||
ExportDefaultDeclaration: 'ExportDefaultDeclaration',
|
||||
ExportNamedDeclaration: 'ExportNamedDeclaration',
|
||||
ExportSpecifier: 'ExportSpecifier',
|
||||
ExpressionStatement: 'ExpressionStatement',
|
||||
ForStatement: 'ForStatement',
|
||||
ForInStatement: 'ForInStatement',
|
||||
ForOfStatement: 'ForOfStatement',
|
||||
FunctionDeclaration: 'FunctionDeclaration',
|
||||
FunctionExpression: 'FunctionExpression',
|
||||
GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.
|
||||
Identifier: 'Identifier',
|
||||
IfStatement: 'IfStatement',
|
||||
ImportExpression: 'ImportExpression',
|
||||
ImportDeclaration: 'ImportDeclaration',
|
||||
ImportDefaultSpecifier: 'ImportDefaultSpecifier',
|
||||
ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
|
||||
ImportSpecifier: 'ImportSpecifier',
|
||||
Literal: 'Literal',
|
||||
LabeledStatement: 'LabeledStatement',
|
||||
LogicalExpression: 'LogicalExpression',
|
||||
MemberExpression: 'MemberExpression',
|
||||
MetaProperty: 'MetaProperty',
|
||||
MethodDefinition: 'MethodDefinition',
|
||||
ModuleSpecifier: 'ModuleSpecifier',
|
||||
NewExpression: 'NewExpression',
|
||||
ObjectExpression: 'ObjectExpression',
|
||||
ObjectPattern: 'ObjectPattern',
|
||||
PrivateIdentifier: 'PrivateIdentifier',
|
||||
Program: 'Program',
|
||||
Property: 'Property',
|
||||
PropertyDefinition: 'PropertyDefinition',
|
||||
RestElement: 'RestElement',
|
||||
ReturnStatement: 'ReturnStatement',
|
||||
SequenceExpression: 'SequenceExpression',
|
||||
SpreadElement: 'SpreadElement',
|
||||
Super: 'Super',
|
||||
SwitchStatement: 'SwitchStatement',
|
||||
SwitchCase: 'SwitchCase',
|
||||
TaggedTemplateExpression: 'TaggedTemplateExpression',
|
||||
TemplateElement: 'TemplateElement',
|
||||
TemplateLiteral: 'TemplateLiteral',
|
||||
ThisExpression: 'ThisExpression',
|
||||
ThrowStatement: 'ThrowStatement',
|
||||
TryStatement: 'TryStatement',
|
||||
UnaryExpression: 'UnaryExpression',
|
||||
UpdateExpression: 'UpdateExpression',
|
||||
VariableDeclaration: 'VariableDeclaration',
|
||||
VariableDeclarator: 'VariableDeclarator',
|
||||
WhileStatement: 'WhileStatement',
|
||||
WithStatement: 'WithStatement',
|
||||
YieldExpression: 'YieldExpression'
|
||||
};
|
||||
|
||||
VisitorKeys = {
|
||||
AssignmentExpression: ['left', 'right'],
|
||||
AssignmentPattern: ['left', 'right'],
|
||||
ArrayExpression: ['elements'],
|
||||
ArrayPattern: ['elements'],
|
||||
ArrowFunctionExpression: ['params', 'body'],
|
||||
AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
|
||||
BlockStatement: ['body'],
|
||||
BinaryExpression: ['left', 'right'],
|
||||
BreakStatement: ['label'],
|
||||
CallExpression: ['callee', 'arguments'],
|
||||
CatchClause: ['param', 'body'],
|
||||
ChainExpression: ['expression'],
|
||||
ClassBody: ['body'],
|
||||
ClassDeclaration: ['id', 'superClass', 'body'],
|
||||
ClassExpression: ['id', 'superClass', 'body'],
|
||||
ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.
|
||||
ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
|
||||
ConditionalExpression: ['test', 'consequent', 'alternate'],
|
||||
ContinueStatement: ['label'],
|
||||
DebuggerStatement: [],
|
||||
DirectiveStatement: [],
|
||||
DoWhileStatement: ['body', 'test'],
|
||||
EmptyStatement: [],
|
||||
ExportAllDeclaration: ['source'],
|
||||
ExportDefaultDeclaration: ['declaration'],
|
||||
ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
|
||||
ExportSpecifier: ['exported', 'local'],
|
||||
ExpressionStatement: ['expression'],
|
||||
ForStatement: ['init', 'test', 'update', 'body'],
|
||||
ForInStatement: ['left', 'right', 'body'],
|
||||
ForOfStatement: ['left', 'right', 'body'],
|
||||
FunctionDeclaration: ['id', 'params', 'body'],
|
||||
FunctionExpression: ['id', 'params', 'body'],
|
||||
GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
|
||||
Identifier: [],
|
||||
IfStatement: ['test', 'consequent', 'alternate'],
|
||||
ImportExpression: ['source'],
|
||||
ImportDeclaration: ['specifiers', 'source'],
|
||||
ImportDefaultSpecifier: ['local'],
|
||||
ImportNamespaceSpecifier: ['local'],
|
||||
ImportSpecifier: ['imported', 'local'],
|
||||
Literal: [],
|
||||
LabeledStatement: ['label', 'body'],
|
||||
LogicalExpression: ['left', 'right'],
|
||||
MemberExpression: ['object', 'property'],
|
||||
MetaProperty: ['meta', 'property'],
|
||||
MethodDefinition: ['key', 'value'],
|
||||
ModuleSpecifier: [],
|
||||
NewExpression: ['callee', 'arguments'],
|
||||
ObjectExpression: ['properties'],
|
||||
ObjectPattern: ['properties'],
|
||||
PrivateIdentifier: [],
|
||||
Program: ['body'],
|
||||
Property: ['key', 'value'],
|
||||
PropertyDefinition: ['key', 'value'],
|
||||
RestElement: [ 'argument' ],
|
||||
ReturnStatement: ['argument'],
|
||||
SequenceExpression: ['expressions'],
|
||||
SpreadElement: ['argument'],
|
||||
Super: [],
|
||||
SwitchStatement: ['discriminant', 'cases'],
|
||||
SwitchCase: ['test', 'consequent'],
|
||||
TaggedTemplateExpression: ['tag', 'quasi'],
|
||||
TemplateElement: [],
|
||||
TemplateLiteral: ['quasis', 'expressions'],
|
||||
ThisExpression: [],
|
||||
ThrowStatement: ['argument'],
|
||||
TryStatement: ['block', 'handler', 'finalizer'],
|
||||
UnaryExpression: ['argument'],
|
||||
UpdateExpression: ['argument'],
|
||||
VariableDeclaration: ['declarations'],
|
||||
VariableDeclarator: ['id', 'init'],
|
||||
WhileStatement: ['test', 'body'],
|
||||
WithStatement: ['object', 'body'],
|
||||
YieldExpression: ['argument']
|
||||
};
|
||||
|
||||
// unique id
|
||||
BREAK = {};
|
||||
SKIP = {};
|
||||
REMOVE = {};
|
||||
|
||||
VisitorOption = {
|
||||
Break: BREAK,
|
||||
Skip: SKIP,
|
||||
Remove: REMOVE
|
||||
};
|
||||
|
||||
function Reference(parent, key) {
|
||||
this.parent = parent;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
Reference.prototype.replace = function replace(node) {
|
||||
this.parent[this.key] = node;
|
||||
};
|
||||
|
||||
Reference.prototype.remove = function remove() {
|
||||
if (Array.isArray(this.parent)) {
|
||||
this.parent.splice(this.key, 1);
|
||||
return true;
|
||||
} else {
|
||||
this.replace(null);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
function Element(node, path, wrap, ref) {
|
||||
this.node = node;
|
||||
this.path = path;
|
||||
this.wrap = wrap;
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
function Controller() { }
|
||||
|
||||
// API:
|
||||
// return property path array from root to current node
|
||||
Controller.prototype.path = function path() {
|
||||
var i, iz, j, jz, result, element;
|
||||
|
||||
function addToPath(result, path) {
|
||||
if (Array.isArray(path)) {
|
||||
for (j = 0, jz = path.length; j < jz; ++j) {
|
||||
result.push(path[j]);
|
||||
}
|
||||
} else {
|
||||
result.push(path);
|
||||
}
|
||||
}
|
||||
|
||||
// root node
|
||||
if (!this.__current.path) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// first node is sentinel, second node is root element
|
||||
result = [];
|
||||
for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
|
||||
element = this.__leavelist[i];
|
||||
addToPath(result, element.path);
|
||||
}
|
||||
addToPath(result, this.__current.path);
|
||||
return result;
|
||||
};
|
||||
|
||||
// API:
|
||||
// return type of current node
|
||||
Controller.prototype.type = function () {
|
||||
var node = this.current();
|
||||
return node.type || this.__current.wrap;
|
||||
};
|
||||
|
||||
// API:
|
||||
// return array of parent elements
|
||||
Controller.prototype.parents = function parents() {
|
||||
var i, iz, result;
|
||||
|
||||
// first node is sentinel
|
||||
result = [];
|
||||
for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
|
||||
result.push(this.__leavelist[i].node);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// API:
|
||||
// return current node
|
||||
Controller.prototype.current = function current() {
|
||||
return this.__current.node;
|
||||
};
|
||||
|
||||
Controller.prototype.__execute = function __execute(callback, element) {
|
||||
var previous, result;
|
||||
|
||||
result = undefined;
|
||||
|
||||
previous = this.__current;
|
||||
this.__current = element;
|
||||
this.__state = null;
|
||||
if (callback) {
|
||||
result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
|
||||
}
|
||||
this.__current = previous;
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
// API:
|
||||
// notify control skip / break
|
||||
Controller.prototype.notify = function notify(flag) {
|
||||
this.__state = flag;
|
||||
};
|
||||
|
||||
// API:
|
||||
// skip child nodes of current node
|
||||
Controller.prototype.skip = function () {
|
||||
this.notify(SKIP);
|
||||
};
|
||||
|
||||
// API:
|
||||
// break traversals
|
||||
Controller.prototype['break'] = function () {
|
||||
this.notify(BREAK);
|
||||
};
|
||||
|
||||
// API:
|
||||
// remove node
|
||||
Controller.prototype.remove = function () {
|
||||
this.notify(REMOVE);
|
||||
};
|
||||
|
||||
Controller.prototype.__initialize = function(root, visitor) {
|
||||
this.visitor = visitor;
|
||||
this.root = root;
|
||||
this.__worklist = [];
|
||||
this.__leavelist = [];
|
||||
this.__current = null;
|
||||
this.__state = null;
|
||||
this.__fallback = null;
|
||||
if (visitor.fallback === 'iteration') {
|
||||
this.__fallback = Object.keys;
|
||||
} else if (typeof visitor.fallback === 'function') {
|
||||
this.__fallback = visitor.fallback;
|
||||
}
|
||||
|
||||
this.__keys = VisitorKeys;
|
||||
if (visitor.keys) {
|
||||
this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
|
||||
}
|
||||
};
|
||||
|
||||
function isNode(node) {
|
||||
if (node == null) {
|
||||
return false;
|
||||
}
|
||||
return typeof node === 'object' && typeof node.type === 'string';
|
||||
}
|
||||
|
||||
function isProperty(nodeType, key) {
|
||||
return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
|
||||
}
|
||||
|
||||
function candidateExistsInLeaveList(leavelist, candidate) {
|
||||
for (var i = leavelist.length - 1; i >= 0; --i) {
|
||||
if (leavelist[i].node === candidate) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Controller.prototype.traverse = function traverse(root, visitor) {
|
||||
var worklist,
|
||||
leavelist,
|
||||
element,
|
||||
node,
|
||||
nodeType,
|
||||
ret,
|
||||
key,
|
||||
current,
|
||||
current2,
|
||||
candidates,
|
||||
candidate,
|
||||
sentinel;
|
||||
|
||||
this.__initialize(root, visitor);
|
||||
|
||||
sentinel = {};
|
||||
|
||||
// reference
|
||||
worklist = this.__worklist;
|
||||
leavelist = this.__leavelist;
|
||||
|
||||
// initialize
|
||||
worklist.push(new Element(root, null, null, null));
|
||||
leavelist.push(new Element(null, null, null, null));
|
||||
|
||||
while (worklist.length) {
|
||||
element = worklist.pop();
|
||||
|
||||
if (element === sentinel) {
|
||||
element = leavelist.pop();
|
||||
|
||||
ret = this.__execute(visitor.leave, element);
|
||||
|
||||
if (this.__state === BREAK || ret === BREAK) {
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (element.node) {
|
||||
|
||||
ret = this.__execute(visitor.enter, element);
|
||||
|
||||
if (this.__state === BREAK || ret === BREAK) {
|
||||
return;
|
||||
}
|
||||
|
||||
worklist.push(sentinel);
|
||||
leavelist.push(element);
|
||||
|
||||
if (this.__state === SKIP || ret === SKIP) {
|
||||
continue;
|
||||
}
|
||||
|
||||
node = element.node;
|
||||
nodeType = node.type || element.wrap;
|
||||
candidates = this.__keys[nodeType];
|
||||
if (!candidates) {
|
||||
if (this.__fallback) {
|
||||
candidates = this.__fallback(node);
|
||||
} else {
|
||||
throw new Error('Unknown node type ' + nodeType + '.');
|
||||
}
|
||||
}
|
||||
|
||||
current = candidates.length;
|
||||
while ((current -= 1) >= 0) {
|
||||
key = candidates[current];
|
||||
candidate = node[key];
|
||||
if (!candidate) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Array.isArray(candidate)) {
|
||||
current2 = candidate.length;
|
||||
while ((current2 -= 1) >= 0) {
|
||||
if (!candidate[current2]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isProperty(nodeType, candidates[current])) {
|
||||
element = new Element(candidate[current2], [key, current2], 'Property', null);
|
||||
} else if (isNode(candidate[current2])) {
|
||||
element = new Element(candidate[current2], [key, current2], null, null);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
worklist.push(element);
|
||||
}
|
||||
} else if (isNode(candidate)) {
|
||||
if (candidateExistsInLeaveList(leavelist, candidate)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
worklist.push(new Element(candidate, key, null, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Controller.prototype.replace = function replace(root, visitor) {
|
||||
var worklist,
|
||||
leavelist,
|
||||
node,
|
||||
nodeType,
|
||||
target,
|
||||
element,
|
||||
current,
|
||||
current2,
|
||||
candidates,
|
||||
candidate,
|
||||
sentinel,
|
||||
outer,
|
||||
key;
|
||||
|
||||
function removeElem(element) {
|
||||
var i,
|
||||
key,
|
||||
nextElem,
|
||||
parent;
|
||||
|
||||
if (element.ref.remove()) {
|
||||
// When the reference is an element of an array.
|
||||
key = element.ref.key;
|
||||
parent = element.ref.parent;
|
||||
|
||||
// If removed from array, then decrease following items' keys.
|
||||
i = worklist.length;
|
||||
while (i--) {
|
||||
nextElem = worklist[i];
|
||||
if (nextElem.ref && nextElem.ref.parent === parent) {
|
||||
if (nextElem.ref.key < key) {
|
||||
break;
|
||||
}
|
||||
--nextElem.ref.key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.__initialize(root, visitor);
|
||||
|
||||
sentinel = {};
|
||||
|
||||
// reference
|
||||
worklist = this.__worklist;
|
||||
leavelist = this.__leavelist;
|
||||
|
||||
// initialize
|
||||
outer = {
|
||||
root: root
|
||||
};
|
||||
element = new Element(root, null, null, new Reference(outer, 'root'));
|
||||
worklist.push(element);
|
||||
leavelist.push(element);
|
||||
|
||||
while (worklist.length) {
|
||||
element = worklist.pop();
|
||||
|
||||
if (element === sentinel) {
|
||||
element = leavelist.pop();
|
||||
|
||||
target = this.__execute(visitor.leave, element);
|
||||
|
||||
// node may be replaced with null,
|
||||
// so distinguish between undefined and null in this place
|
||||
if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
|
||||
// replace
|
||||
element.ref.replace(target);
|
||||
}
|
||||
|
||||
if (this.__state === REMOVE || target === REMOVE) {
|
||||
removeElem(element);
|
||||
}
|
||||
|
||||
if (this.__state === BREAK || target === BREAK) {
|
||||
return outer.root;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
target = this.__execute(visitor.enter, element);
|
||||
|
||||
// node may be replaced with null,
|
||||
// so distinguish between undefined and null in this place
|
||||
if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
|
||||
// replace
|
||||
element.ref.replace(target);
|
||||
element.node = target;
|
||||
}
|
||||
|
||||
if (this.__state === REMOVE || target === REMOVE) {
|
||||
removeElem(element);
|
||||
element.node = null;
|
||||
}
|
||||
|
||||
if (this.__state === BREAK || target === BREAK) {
|
||||
return outer.root;
|
||||
}
|
||||
|
||||
// node may be null
|
||||
node = element.node;
|
||||
if (!node) {
|
||||
continue;
|
||||
}
|
||||
|
||||
worklist.push(sentinel);
|
||||
leavelist.push(element);
|
||||
|
||||
if (this.__state === SKIP || target === SKIP) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nodeType = node.type || element.wrap;
|
||||
candidates = this.__keys[nodeType];
|
||||
if (!candidates) {
|
||||
if (this.__fallback) {
|
||||
candidates = this.__fallback(node);
|
||||
} else {
|
||||
throw new Error('Unknown node type ' + nodeType + '.');
|
||||
}
|
||||
}
|
||||
|
||||
current = candidates.length;
|
||||
while ((current -= 1) >= 0) {
|
||||
key = candidates[current];
|
||||
candidate = node[key];
|
||||
if (!candidate) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Array.isArray(candidate)) {
|
||||
current2 = candidate.length;
|
||||
while ((current2 -= 1) >= 0) {
|
||||
if (!candidate[current2]) {
|
||||
continue;
|
||||
}
|
||||
if (isProperty(nodeType, candidates[current])) {
|
||||
element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
|
||||
} else if (isNode(candidate[current2])) {
|
||||
element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
worklist.push(element);
|
||||
}
|
||||
} else if (isNode(candidate)) {
|
||||
worklist.push(new Element(candidate, key, null, new Reference(node, key)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return outer.root;
|
||||
};
|
||||
|
||||
function traverse(root, visitor) {
|
||||
var controller = new Controller();
|
||||
return controller.traverse(root, visitor);
|
||||
}
|
||||
|
||||
function replace(root, visitor) {
|
||||
var controller = new Controller();
|
||||
return controller.replace(root, visitor);
|
||||
}
|
||||
|
||||
function extendCommentRange(comment, tokens) {
|
||||
var target;
|
||||
|
||||
target = upperBound(tokens, function search(token) {
|
||||
return token.range[0] > comment.range[0];
|
||||
});
|
||||
|
||||
comment.extendedRange = [comment.range[0], comment.range[1]];
|
||||
|
||||
if (target !== tokens.length) {
|
||||
comment.extendedRange[1] = tokens[target].range[0];
|
||||
}
|
||||
|
||||
target -= 1;
|
||||
if (target >= 0) {
|
||||
comment.extendedRange[0] = tokens[target].range[1];
|
||||
}
|
||||
|
||||
return comment;
|
||||
}
|
||||
|
||||
function attachComments(tree, providedComments, tokens) {
|
||||
// At first, we should calculate extended comment ranges.
|
||||
var comments = [], comment, len, i, cursor;
|
||||
|
||||
if (!tree.range) {
|
||||
throw new Error('attachComments needs range information');
|
||||
}
|
||||
|
||||
// tokens array is empty, we attach comments to tree as 'leadingComments'
|
||||
if (!tokens.length) {
|
||||
if (providedComments.length) {
|
||||
for (i = 0, len = providedComments.length; i < len; i += 1) {
|
||||
comment = deepCopy(providedComments[i]);
|
||||
comment.extendedRange = [0, tree.range[0]];
|
||||
comments.push(comment);
|
||||
}
|
||||
tree.leadingComments = comments;
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
for (i = 0, len = providedComments.length; i < len; i += 1) {
|
||||
comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
|
||||
}
|
||||
|
||||
// This is based on John Freeman's implementation.
|
||||
cursor = 0;
|
||||
traverse(tree, {
|
||||
enter: function (node) {
|
||||
var comment;
|
||||
|
||||
while (cursor < comments.length) {
|
||||
comment = comments[cursor];
|
||||
if (comment.extendedRange[1] > node.range[0]) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (comment.extendedRange[1] === node.range[0]) {
|
||||
if (!node.leadingComments) {
|
||||
node.leadingComments = [];
|
||||
}
|
||||
node.leadingComments.push(comment);
|
||||
comments.splice(cursor, 1);
|
||||
} else {
|
||||
cursor += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// already out of owned node
|
||||
if (cursor === comments.length) {
|
||||
return VisitorOption.Break;
|
||||
}
|
||||
|
||||
if (comments[cursor].extendedRange[0] > node.range[1]) {
|
||||
return VisitorOption.Skip;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cursor = 0;
|
||||
traverse(tree, {
|
||||
leave: function (node) {
|
||||
var comment;
|
||||
|
||||
while (cursor < comments.length) {
|
||||
comment = comments[cursor];
|
||||
if (node.range[1] < comment.extendedRange[0]) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (node.range[1] === comment.extendedRange[0]) {
|
||||
if (!node.trailingComments) {
|
||||
node.trailingComments = [];
|
||||
}
|
||||
node.trailingComments.push(comment);
|
||||
comments.splice(cursor, 1);
|
||||
} else {
|
||||
cursor += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// already out of owned node
|
||||
if (cursor === comments.length) {
|
||||
return VisitorOption.Break;
|
||||
}
|
||||
|
||||
if (comments[cursor].extendedRange[0] > node.range[1]) {
|
||||
return VisitorOption.Skip;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
exports.Syntax = Syntax;
|
||||
exports.traverse = traverse;
|
||||
exports.replace = replace;
|
||||
exports.attachComments = attachComments;
|
||||
exports.VisitorKeys = VisitorKeys;
|
||||
exports.VisitorOption = VisitorOption;
|
||||
exports.Controller = Controller;
|
||||
exports.cloneEnvironment = function () { return clone({}); };
|
||||
|
||||
return exports;
|
||||
}(exports));
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
});
|
||||
|
||||
export default estraverse;
|
||||
|
|
@ -5,10 +5,16 @@
|
|||
"codemirror/mode/javascript/javascript.js": "./codemirror/mode/javascript/javascript.js",
|
||||
"codemirror/mode/pegjs/pegjs.js": "./codemirror/mode/pegjs/pegjs.js",
|
||||
"codemirror/theme/material.css": "./codemirror/theme/material.css",
|
||||
"estraverse": "./estraverse.js",
|
||||
"fraction.js": "./fractionjs.js",
|
||||
"multimap": "./multimap.js",
|
||||
"react": "./react.js",
|
||||
"react-codemirror2": "./react-codemirror2.js",
|
||||
"react-dom": "./react-dom.js",
|
||||
"shift-ast": "./shift-ast.js",
|
||||
"shift-codegen": "./shift-codegen.js",
|
||||
"shift-regexp-acceptor": "./shift-regexp-acceptor.js",
|
||||
"shift-spec": "./shift-spec.js",
|
||||
"tone": "./tone.js"
|
||||
}
|
||||
}
|
||||
229
docs/_snowpack/pkg/multimap.js
Normal file
229
docs/_snowpack/pkg/multimap.js
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js';
|
||||
|
||||
var multimap = createCommonjsModule(function (module, exports) {
|
||||
|
||||
/* global module, define */
|
||||
|
||||
function mapEach(map, operation){
|
||||
var keys = map.keys();
|
||||
var next;
|
||||
while(!(next = keys.next()).done) {
|
||||
operation(map.get(next.value), next.value, map);
|
||||
}
|
||||
}
|
||||
|
||||
var Multimap = (function() {
|
||||
var mapCtor;
|
||||
if (typeof Map !== 'undefined') {
|
||||
mapCtor = Map;
|
||||
|
||||
if (!Map.prototype.keys) {
|
||||
Map.prototype.keys = function() {
|
||||
var keys = [];
|
||||
this.forEach(function(item, key) {
|
||||
keys.push(key);
|
||||
});
|
||||
return keys;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function Multimap(iterable) {
|
||||
var self = this;
|
||||
|
||||
self._map = mapCtor;
|
||||
|
||||
if (Multimap.Map) {
|
||||
self._map = Multimap.Map;
|
||||
}
|
||||
|
||||
self._ = self._map ? new self._map() : {};
|
||||
|
||||
if (iterable) {
|
||||
iterable.forEach(function(i) {
|
||||
self.set(i[0], i[1]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} key
|
||||
* @return {Array} An array of values, undefined if no such a key;
|
||||
*/
|
||||
Multimap.prototype.get = function(key) {
|
||||
return this._map ? this._.get(key) : this._[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} key
|
||||
* @param {Object} val...
|
||||
*/
|
||||
Multimap.prototype.set = function(key, val) {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
|
||||
key = args.shift();
|
||||
|
||||
var entry = this.get(key);
|
||||
if (!entry) {
|
||||
entry = [];
|
||||
if (this._map)
|
||||
this._.set(key, entry);
|
||||
else
|
||||
this._[key] = entry;
|
||||
}
|
||||
|
||||
Array.prototype.push.apply(entry, args);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} key
|
||||
* @param {Object=} val
|
||||
* @return {boolean} true if any thing changed
|
||||
*/
|
||||
Multimap.prototype.delete = function(key, val) {
|
||||
if (!this.has(key))
|
||||
return false;
|
||||
|
||||
if (arguments.length == 1) {
|
||||
this._map ? (this._.delete(key)) : (delete this._[key]);
|
||||
return true;
|
||||
} else {
|
||||
var entry = this.get(key);
|
||||
var idx = entry.indexOf(val);
|
||||
if (idx != -1) {
|
||||
entry.splice(idx, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Object} key
|
||||
* @param {Object=} val
|
||||
* @return {boolean} whether the map contains 'key' or 'key=>val' pair
|
||||
*/
|
||||
Multimap.prototype.has = function(key, val) {
|
||||
var hasKey = this._map ? this._.has(key) : this._.hasOwnProperty(key);
|
||||
|
||||
if (arguments.length == 1 || !hasKey)
|
||||
return hasKey;
|
||||
|
||||
var entry = this.get(key) || [];
|
||||
return entry.indexOf(val) != -1;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array} all the keys in the map
|
||||
*/
|
||||
Multimap.prototype.keys = function() {
|
||||
if (this._map)
|
||||
return makeIterator(this._.keys());
|
||||
|
||||
return makeIterator(Object.keys(this._));
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {Array} all the values in the map
|
||||
*/
|
||||
Multimap.prototype.values = function() {
|
||||
var vals = [];
|
||||
this.forEachEntry(function(entry) {
|
||||
Array.prototype.push.apply(vals, entry);
|
||||
});
|
||||
|
||||
return makeIterator(vals);
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Multimap.prototype.forEachEntry = function(iter) {
|
||||
mapEach(this, iter);
|
||||
};
|
||||
|
||||
Multimap.prototype.forEach = function(iter) {
|
||||
var self = this;
|
||||
self.forEachEntry(function(entry, key) {
|
||||
entry.forEach(function(item) {
|
||||
iter(item, key, self);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Multimap.prototype.clear = function() {
|
||||
if (this._map) {
|
||||
this._.clear();
|
||||
} else {
|
||||
this._ = {};
|
||||
}
|
||||
};
|
||||
|
||||
Object.defineProperty(
|
||||
Multimap.prototype,
|
||||
"size", {
|
||||
configurable: false,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
var total = 0;
|
||||
|
||||
mapEach(this, function(value){
|
||||
total += value.length;
|
||||
});
|
||||
|
||||
return total;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(
|
||||
Multimap.prototype,
|
||||
"count", {
|
||||
configurable: false,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return this._.size;
|
||||
}
|
||||
});
|
||||
|
||||
var safariNext;
|
||||
|
||||
try{
|
||||
safariNext = new Function('iterator', 'makeIterator', 'var keysArray = []; for(var key of iterator){keysArray.push(key);} return makeIterator(keysArray).next;');
|
||||
}catch(error){
|
||||
// for of not implemented;
|
||||
}
|
||||
|
||||
function makeIterator(iterator){
|
||||
if(Array.isArray(iterator)){
|
||||
var nextIndex = 0;
|
||||
|
||||
return {
|
||||
next: function(){
|
||||
return nextIndex < iterator.length ?
|
||||
{value: iterator[nextIndex++], done: false} :
|
||||
{done: true};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Only an issue in safari
|
||||
if(!iterator.next && safariNext){
|
||||
iterator.next = safariNext(iterator, makeIterator);
|
||||
}
|
||||
|
||||
return iterator;
|
||||
}
|
||||
|
||||
return Multimap;
|
||||
})();
|
||||
|
||||
|
||||
if( module && module.exports)
|
||||
module.exports = Multimap;
|
||||
});
|
||||
|
||||
export default multimap;
|
||||
3
docs/_snowpack/pkg/react-codemirror2.js
vendored
3
docs/_snowpack/pkg/react-codemirror2.js
vendored
|
|
@ -1,6 +1,7 @@
|
|||
import { c as createCommonjsModule, a as commonjsGlobal } from './common/_commonjsHelpers-8c19dec8.js';
|
||||
import { r as react } from './common/index-04edb6a1.js';
|
||||
import { r as react } from './common/index-67cfdec9.js';
|
||||
import { c as codemirror } from './common/codemirror-d650d44d.js';
|
||||
import './common/index-d01087d6.js';
|
||||
|
||||
var reactCodemirror2 = createCommonjsModule(function (module, exports) {
|
||||
|
||||
|
|
|
|||
3
docs/_snowpack/pkg/react-dom.js
vendored
3
docs/_snowpack/pkg/react-dom.js
vendored
|
|
@ -1,5 +1,6 @@
|
|||
import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js';
|
||||
import { r as react, o as objectAssign } from './common/index-04edb6a1.js';
|
||||
import { r as react } from './common/index-67cfdec9.js';
|
||||
import { o as objectAssign } from './common/index-d01087d6.js';
|
||||
|
||||
var scheduler_production_min = createCommonjsModule(function (module, exports) {
|
||||
var f,g,h,k;if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q};}
|
||||
|
|
|
|||
5
docs/_snowpack/pkg/react.js
vendored
5
docs/_snowpack/pkg/react.js
vendored
|
|
@ -1,6 +1,7 @@
|
|||
import { r as react } from './common/index-04edb6a1.js';
|
||||
export { r as default } from './common/index-04edb6a1.js';
|
||||
import { r as react } from './common/index-67cfdec9.js';
|
||||
export { r as default } from './common/index-67cfdec9.js';
|
||||
import './common/_commonjsHelpers-8c19dec8.js';
|
||||
import './common/index-d01087d6.js';
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
106
docs/_snowpack/pkg/shift-ast.js
Normal file
106
docs/_snowpack/pkg/shift-ast.js
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
import { _ as __pika_web_default_export_for_treeshaking__, d as dist } from './common/index-1e63141f.js';
|
||||
export { d as __moduleExports, _ as default } from './common/index-1e63141f.js';
|
||||
import './common/_commonjsHelpers-8c19dec8.js';
|
||||
|
||||
|
||||
|
||||
var ArrayAssignmentTarget = dist.ArrayAssignmentTarget;
|
||||
var ArrayBinding = dist.ArrayBinding;
|
||||
var ArrayExpression = dist.ArrayExpression;
|
||||
var ArrowExpression = dist.ArrowExpression;
|
||||
var AssignmentExpression = dist.AssignmentExpression;
|
||||
var AssignmentTargetIdentifier = dist.AssignmentTargetIdentifier;
|
||||
var AssignmentTargetPropertyIdentifier = dist.AssignmentTargetPropertyIdentifier;
|
||||
var AssignmentTargetPropertyProperty = dist.AssignmentTargetPropertyProperty;
|
||||
var AssignmentTargetWithDefault = dist.AssignmentTargetWithDefault;
|
||||
var AwaitExpression = dist.AwaitExpression;
|
||||
var BinaryExpression = dist.BinaryExpression;
|
||||
var BindingIdentifier = dist.BindingIdentifier;
|
||||
var BindingPropertyIdentifier = dist.BindingPropertyIdentifier;
|
||||
var BindingPropertyProperty = dist.BindingPropertyProperty;
|
||||
var BindingWithDefault = dist.BindingWithDefault;
|
||||
var Block = dist.Block;
|
||||
var BlockStatement = dist.BlockStatement;
|
||||
var BreakStatement = dist.BreakStatement;
|
||||
var CallExpression = dist.CallExpression;
|
||||
var CatchClause = dist.CatchClause;
|
||||
var ClassDeclaration = dist.ClassDeclaration;
|
||||
var ClassElement = dist.ClassElement;
|
||||
var ClassExpression = dist.ClassExpression;
|
||||
var CompoundAssignmentExpression = dist.CompoundAssignmentExpression;
|
||||
var ComputedMemberAssignmentTarget = dist.ComputedMemberAssignmentTarget;
|
||||
var ComputedMemberExpression = dist.ComputedMemberExpression;
|
||||
var ComputedPropertyName = dist.ComputedPropertyName;
|
||||
var ConditionalExpression = dist.ConditionalExpression;
|
||||
var ContinueStatement = dist.ContinueStatement;
|
||||
var DataProperty = dist.DataProperty;
|
||||
var DebuggerStatement = dist.DebuggerStatement;
|
||||
var Directive = dist.Directive;
|
||||
var DoWhileStatement = dist.DoWhileStatement;
|
||||
var EmptyStatement = dist.EmptyStatement;
|
||||
var Export = dist.Export;
|
||||
var ExportAllFrom = dist.ExportAllFrom;
|
||||
var ExportDefault = dist.ExportDefault;
|
||||
var ExportFrom = dist.ExportFrom;
|
||||
var ExportFromSpecifier = dist.ExportFromSpecifier;
|
||||
var ExportLocalSpecifier = dist.ExportLocalSpecifier;
|
||||
var ExportLocals = dist.ExportLocals;
|
||||
var ExpressionStatement = dist.ExpressionStatement;
|
||||
var ForAwaitStatement = dist.ForAwaitStatement;
|
||||
var ForInStatement = dist.ForInStatement;
|
||||
var ForOfStatement = dist.ForOfStatement;
|
||||
var ForStatement = dist.ForStatement;
|
||||
var FormalParameters = dist.FormalParameters;
|
||||
var FunctionBody = dist.FunctionBody;
|
||||
var FunctionDeclaration = dist.FunctionDeclaration;
|
||||
var FunctionExpression = dist.FunctionExpression;
|
||||
var Getter = dist.Getter;
|
||||
var IdentifierExpression = dist.IdentifierExpression;
|
||||
var IfStatement = dist.IfStatement;
|
||||
var Import = dist.Import;
|
||||
var ImportNamespace = dist.ImportNamespace;
|
||||
var ImportSpecifier = dist.ImportSpecifier;
|
||||
var LabeledStatement = dist.LabeledStatement;
|
||||
var LiteralBooleanExpression = dist.LiteralBooleanExpression;
|
||||
var LiteralInfinityExpression = dist.LiteralInfinityExpression;
|
||||
var LiteralNullExpression = dist.LiteralNullExpression;
|
||||
var LiteralNumericExpression = dist.LiteralNumericExpression;
|
||||
var LiteralRegExpExpression = dist.LiteralRegExpExpression;
|
||||
var LiteralStringExpression = dist.LiteralStringExpression;
|
||||
var Method = dist.Method;
|
||||
var Module = dist.Module;
|
||||
var NewExpression = dist.NewExpression;
|
||||
var NewTargetExpression = dist.NewTargetExpression;
|
||||
var ObjectAssignmentTarget = dist.ObjectAssignmentTarget;
|
||||
var ObjectBinding = dist.ObjectBinding;
|
||||
var ObjectExpression = dist.ObjectExpression;
|
||||
var ReturnStatement = dist.ReturnStatement;
|
||||
var Script = dist.Script;
|
||||
var Setter = dist.Setter;
|
||||
var ShorthandProperty = dist.ShorthandProperty;
|
||||
var SpreadElement = dist.SpreadElement;
|
||||
var SpreadProperty = dist.SpreadProperty;
|
||||
var StaticMemberAssignmentTarget = dist.StaticMemberAssignmentTarget;
|
||||
var StaticMemberExpression = dist.StaticMemberExpression;
|
||||
var StaticPropertyName = dist.StaticPropertyName;
|
||||
var Super = dist.Super;
|
||||
var SwitchCase = dist.SwitchCase;
|
||||
var SwitchDefault = dist.SwitchDefault;
|
||||
var SwitchStatement = dist.SwitchStatement;
|
||||
var SwitchStatementWithDefault = dist.SwitchStatementWithDefault;
|
||||
var TemplateElement = dist.TemplateElement;
|
||||
var TemplateExpression = dist.TemplateExpression;
|
||||
var ThisExpression = dist.ThisExpression;
|
||||
var ThrowStatement = dist.ThrowStatement;
|
||||
var TryCatchStatement = dist.TryCatchStatement;
|
||||
var TryFinallyStatement = dist.TryFinallyStatement;
|
||||
var UnaryExpression = dist.UnaryExpression;
|
||||
var UpdateExpression = dist.UpdateExpression;
|
||||
var VariableDeclaration = dist.VariableDeclaration;
|
||||
var VariableDeclarationStatement = dist.VariableDeclarationStatement;
|
||||
var VariableDeclarator = dist.VariableDeclarator;
|
||||
var WhileStatement = dist.WhileStatement;
|
||||
var WithStatement = dist.WithStatement;
|
||||
var YieldExpression = dist.YieldExpression;
|
||||
var YieldGeneratorExpression = dist.YieldGeneratorExpression;
|
||||
export { ArrayAssignmentTarget, ArrayBinding, ArrayExpression, ArrowExpression, AssignmentExpression, AssignmentTargetIdentifier, AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty, AssignmentTargetWithDefault, AwaitExpression, BinaryExpression, BindingIdentifier, BindingPropertyIdentifier, BindingPropertyProperty, BindingWithDefault, Block, BlockStatement, BreakStatement, CallExpression, CatchClause, ClassDeclaration, ClassElement, ClassExpression, CompoundAssignmentExpression, ComputedMemberAssignmentTarget, ComputedMemberExpression, ComputedPropertyName, ConditionalExpression, ContinueStatement, DataProperty, DebuggerStatement, Directive, DoWhileStatement, EmptyStatement, Export, ExportAllFrom, ExportDefault, ExportFrom, ExportFromSpecifier, ExportLocalSpecifier, ExportLocals, ExpressionStatement, ForAwaitStatement, ForInStatement, ForOfStatement, ForStatement, FormalParameters, FunctionBody, FunctionDeclaration, FunctionExpression, Getter, IdentifierExpression, IfStatement, Import, ImportNamespace, ImportSpecifier, LabeledStatement, LiteralBooleanExpression, LiteralInfinityExpression, LiteralNullExpression, LiteralNumericExpression, LiteralRegExpExpression, LiteralStringExpression, Method, Module, NewExpression, NewTargetExpression, ObjectAssignmentTarget, ObjectBinding, ObjectExpression, ReturnStatement, Script, Setter, ShorthandProperty, SpreadElement, SpreadProperty, StaticMemberAssignmentTarget, StaticMemberExpression, StaticPropertyName, Super, SwitchCase, SwitchDefault, SwitchStatement, SwitchStatementWithDefault, TemplateElement, TemplateExpression, ThisExpression, ThrowStatement, TryCatchStatement, TryFinallyStatement, UnaryExpression, UpdateExpression, VariableDeclaration, VariableDeclarationStatement, VariableDeclarator, WhileStatement, WithStatement, YieldExpression, YieldGeneratorExpression };
|
||||
11828
docs/_snowpack/pkg/shift-codegen.js
Normal file
11828
docs/_snowpack/pkg/shift-codegen.js
Normal file
File diff suppressed because one or more lines are too long
1771
docs/_snowpack/pkg/shift-regexp-acceptor.js
Normal file
1771
docs/_snowpack/pkg/shift-regexp-acceptor.js
Normal file
File diff suppressed because one or more lines are too long
876
docs/_snowpack/pkg/shift-spec.js
Normal file
876
docs/_snowpack/pkg/shift-spec.js
Normal file
|
|
@ -0,0 +1,876 @@
|
|||
import { g as getDefaultExportFromCjs, c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js';
|
||||
|
||||
var dist = createCommonjsModule(function (module, exports) {
|
||||
// Generated by src/generate-spec.js.
|
||||
|
||||
/**
|
||||
* Copyright 2016 Shape Security, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Hack to make Babel6 import this as a module.
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
exports.default = (function() {
|
||||
var SPEC = {};
|
||||
|
||||
var BOOLEAN = { typeName: "Boolean" };
|
||||
var DOUBLE = { typeName: "Number" };
|
||||
var STRING = { typeName: "String" };
|
||||
function Maybe(arg) { return { typeName: "Maybe", argument: arg }; }
|
||||
function List(arg) { return { typeName: "List", argument: arg }; }
|
||||
function Const(arg) { return { typeName: "Const", argument: arg }; }
|
||||
function Union() { return { typeName: "Union", arguments: [].slice.call(arguments, 0) }; }
|
||||
|
||||
|
||||
var TYPE_INDICATOR = {
|
||||
typeName: "Enum",
|
||||
values: ["ArrayAssignmentTarget", "ArrayBinding", "ArrayExpression", "ArrowExpression", "AssignmentExpression", "AssignmentTargetIdentifier", "AssignmentTargetPropertyIdentifier", "AssignmentTargetPropertyProperty", "AssignmentTargetWithDefault", "AwaitExpression", "BinaryExpression", "BindingIdentifier", "BindingPropertyIdentifier", "BindingPropertyProperty", "BindingWithDefault", "Block", "BlockStatement", "BreakStatement", "CallExpression", "CatchClause", "ClassDeclaration", "ClassElement", "ClassExpression", "CompoundAssignmentExpression", "ComputedMemberAssignmentTarget", "ComputedMemberExpression", "ComputedPropertyName", "ConditionalExpression", "ContinueStatement", "DataProperty", "DebuggerStatement", "Directive", "DoWhileStatement", "EmptyStatement", "Export", "ExportAllFrom", "ExportDefault", "ExportFrom", "ExportFromSpecifier", "ExportLocalSpecifier", "ExportLocals", "ExpressionStatement", "ForAwaitStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FormalParameters", "FunctionBody", "FunctionDeclaration", "FunctionExpression", "Getter", "IdentifierExpression", "IfStatement", "Import", "ImportNamespace", "ImportSpecifier", "LabeledStatement", "LiteralBooleanExpression", "LiteralInfinityExpression", "LiteralNullExpression", "LiteralNumericExpression", "LiteralRegExpExpression", "LiteralStringExpression", "Method", "Module", "NewExpression", "NewTargetExpression", "ObjectAssignmentTarget", "ObjectBinding", "ObjectExpression", "ReturnStatement", "Script", "Setter", "ShorthandProperty", "SpreadElement", "SpreadProperty", "StaticMemberAssignmentTarget", "StaticMemberExpression", "StaticPropertyName", "Super", "SwitchCase", "SwitchDefault", "SwitchStatement", "SwitchStatementWithDefault", "TemplateElement", "TemplateExpression", "ThisExpression", "ThrowStatement", "TryCatchStatement", "TryFinallyStatement", "UnaryExpression", "UpdateExpression", "VariableDeclaration", "VariableDeclarationStatement", "VariableDeclarator", "WhileStatement", "WithStatement", "YieldExpression", "YieldGeneratorExpression"]
|
||||
};
|
||||
|
||||
var BinaryOperator = {
|
||||
typeName: "Enum",
|
||||
values: ["==", "!=", "===", "!==", "<", "<=", ">", ">=", "in", "instanceof", "<<", ">>", ">>>", "+", "-", "*", "/", "%", "**", ",", "||", "&&", "|", "^", "&"]
|
||||
};
|
||||
|
||||
var CompoundAssignmentOperator = {
|
||||
typeName: "Enum",
|
||||
values: ["+=", "-=", "*=", "/=", "%=", "**=", "<<=", ">>=", ">>>=", "|=", "^=", "&="]
|
||||
};
|
||||
|
||||
var UnaryOperator = {
|
||||
typeName: "Enum",
|
||||
values: ["+", "-", "!", "~", "typeof", "void", "delete"]
|
||||
};
|
||||
|
||||
var UpdateOperator = {
|
||||
typeName: "Enum",
|
||||
values: ["++", "--"]
|
||||
};
|
||||
|
||||
var VariableDeclarationKind = {
|
||||
typeName: "Enum",
|
||||
values: ["var", "let", "const"]
|
||||
};
|
||||
|
||||
|
||||
var ArrayAssignmentTarget = SPEC.ArrayAssignmentTarget = {};
|
||||
var ArrayBinding = SPEC.ArrayBinding = {};
|
||||
var ArrayExpression = SPEC.ArrayExpression = {};
|
||||
var ArrowExpression = SPEC.ArrowExpression = {};
|
||||
var AssignmentExpression = SPEC.AssignmentExpression = {};
|
||||
var AssignmentTargetIdentifier = SPEC.AssignmentTargetIdentifier = {};
|
||||
var AssignmentTargetPropertyIdentifier = SPEC.AssignmentTargetPropertyIdentifier = {};
|
||||
var AssignmentTargetPropertyProperty = SPEC.AssignmentTargetPropertyProperty = {};
|
||||
var AssignmentTargetWithDefault = SPEC.AssignmentTargetWithDefault = {};
|
||||
var AwaitExpression = SPEC.AwaitExpression = {};
|
||||
var BinaryExpression = SPEC.BinaryExpression = {};
|
||||
var BindingIdentifier = SPEC.BindingIdentifier = {};
|
||||
var BindingPropertyIdentifier = SPEC.BindingPropertyIdentifier = {};
|
||||
var BindingPropertyProperty = SPEC.BindingPropertyProperty = {};
|
||||
var BindingWithDefault = SPEC.BindingWithDefault = {};
|
||||
var Block = SPEC.Block = {};
|
||||
var BlockStatement = SPEC.BlockStatement = {};
|
||||
var BreakStatement = SPEC.BreakStatement = {};
|
||||
var CallExpression = SPEC.CallExpression = {};
|
||||
var CatchClause = SPEC.CatchClause = {};
|
||||
var ClassDeclaration = SPEC.ClassDeclaration = {};
|
||||
var ClassElement = SPEC.ClassElement = {};
|
||||
var ClassExpression = SPEC.ClassExpression = {};
|
||||
var CompoundAssignmentExpression = SPEC.CompoundAssignmentExpression = {};
|
||||
var ComputedMemberAssignmentTarget = SPEC.ComputedMemberAssignmentTarget = {};
|
||||
var ComputedMemberExpression = SPEC.ComputedMemberExpression = {};
|
||||
var ComputedPropertyName = SPEC.ComputedPropertyName = {};
|
||||
var ConditionalExpression = SPEC.ConditionalExpression = {};
|
||||
var ContinueStatement = SPEC.ContinueStatement = {};
|
||||
var DataProperty = SPEC.DataProperty = {};
|
||||
var DebuggerStatement = SPEC.DebuggerStatement = {};
|
||||
var Directive = SPEC.Directive = {};
|
||||
var DoWhileStatement = SPEC.DoWhileStatement = {};
|
||||
var EmptyStatement = SPEC.EmptyStatement = {};
|
||||
var Export = SPEC.Export = {};
|
||||
var ExportAllFrom = SPEC.ExportAllFrom = {};
|
||||
var ExportDefault = SPEC.ExportDefault = {};
|
||||
var ExportFrom = SPEC.ExportFrom = {};
|
||||
var ExportFromSpecifier = SPEC.ExportFromSpecifier = {};
|
||||
var ExportLocalSpecifier = SPEC.ExportLocalSpecifier = {};
|
||||
var ExportLocals = SPEC.ExportLocals = {};
|
||||
var ExpressionStatement = SPEC.ExpressionStatement = {};
|
||||
var ForAwaitStatement = SPEC.ForAwaitStatement = {};
|
||||
var ForInStatement = SPEC.ForInStatement = {};
|
||||
var ForOfStatement = SPEC.ForOfStatement = {};
|
||||
var ForStatement = SPEC.ForStatement = {};
|
||||
var FormalParameters = SPEC.FormalParameters = {};
|
||||
var FunctionBody = SPEC.FunctionBody = {};
|
||||
var FunctionDeclaration = SPEC.FunctionDeclaration = {};
|
||||
var FunctionExpression = SPEC.FunctionExpression = {};
|
||||
var Getter = SPEC.Getter = {};
|
||||
var IdentifierExpression = SPEC.IdentifierExpression = {};
|
||||
var IfStatement = SPEC.IfStatement = {};
|
||||
var Import = SPEC.Import = {};
|
||||
var ImportNamespace = SPEC.ImportNamespace = {};
|
||||
var ImportSpecifier = SPEC.ImportSpecifier = {};
|
||||
var LabeledStatement = SPEC.LabeledStatement = {};
|
||||
var LiteralBooleanExpression = SPEC.LiteralBooleanExpression = {};
|
||||
var LiteralInfinityExpression = SPEC.LiteralInfinityExpression = {};
|
||||
var LiteralNullExpression = SPEC.LiteralNullExpression = {};
|
||||
var LiteralNumericExpression = SPEC.LiteralNumericExpression = {};
|
||||
var LiteralRegExpExpression = SPEC.LiteralRegExpExpression = {};
|
||||
var LiteralStringExpression = SPEC.LiteralStringExpression = {};
|
||||
var Method = SPEC.Method = {};
|
||||
var Module = SPEC.Module = {};
|
||||
var NewExpression = SPEC.NewExpression = {};
|
||||
var NewTargetExpression = SPEC.NewTargetExpression = {};
|
||||
var ObjectAssignmentTarget = SPEC.ObjectAssignmentTarget = {};
|
||||
var ObjectBinding = SPEC.ObjectBinding = {};
|
||||
var ObjectExpression = SPEC.ObjectExpression = {};
|
||||
var ReturnStatement = SPEC.ReturnStatement = {};
|
||||
var Script = SPEC.Script = {};
|
||||
var Setter = SPEC.Setter = {};
|
||||
var ShorthandProperty = SPEC.ShorthandProperty = {};
|
||||
var SpreadElement = SPEC.SpreadElement = {};
|
||||
var SpreadProperty = SPEC.SpreadProperty = {};
|
||||
var StaticMemberAssignmentTarget = SPEC.StaticMemberAssignmentTarget = {};
|
||||
var StaticMemberExpression = SPEC.StaticMemberExpression = {};
|
||||
var StaticPropertyName = SPEC.StaticPropertyName = {};
|
||||
var Super = SPEC.Super = {};
|
||||
var SwitchCase = SPEC.SwitchCase = {};
|
||||
var SwitchDefault = SPEC.SwitchDefault = {};
|
||||
var SwitchStatement = SPEC.SwitchStatement = {};
|
||||
var SwitchStatementWithDefault = SPEC.SwitchStatementWithDefault = {};
|
||||
var TemplateElement = SPEC.TemplateElement = {};
|
||||
var TemplateExpression = SPEC.TemplateExpression = {};
|
||||
var ThisExpression = SPEC.ThisExpression = {};
|
||||
var ThrowStatement = SPEC.ThrowStatement = {};
|
||||
var TryCatchStatement = SPEC.TryCatchStatement = {};
|
||||
var TryFinallyStatement = SPEC.TryFinallyStatement = {};
|
||||
var UnaryExpression = SPEC.UnaryExpression = {};
|
||||
var UpdateExpression = SPEC.UpdateExpression = {};
|
||||
var VariableDeclaration = SPEC.VariableDeclaration = {};
|
||||
var VariableDeclarationStatement = SPEC.VariableDeclarationStatement = {};
|
||||
var VariableDeclarator = SPEC.VariableDeclarator = {};
|
||||
var WhileStatement = SPEC.WhileStatement = {};
|
||||
var WithStatement = SPEC.WithStatement = {};
|
||||
var YieldExpression = SPEC.YieldExpression = {};
|
||||
var YieldGeneratorExpression = SPEC.YieldGeneratorExpression = {};
|
||||
|
||||
var MemberExpression = Union(ComputedMemberExpression, StaticMemberExpression);
|
||||
var AssignmentTargetProperty = Union(AssignmentTargetPropertyIdentifier, AssignmentTargetPropertyProperty);
|
||||
var Class = Union(ClassDeclaration, ClassExpression);
|
||||
var ExportDeclaration = Union(Export, ExportAllFrom, ExportDefault, ExportFrom, ExportLocals);
|
||||
var PropertyName = Union(ComputedPropertyName, StaticPropertyName);
|
||||
var Function = Union(FunctionDeclaration, FunctionExpression);
|
||||
var ImportDeclaration = Union(Import, ImportNamespace);
|
||||
var IterationStatement = Union(DoWhileStatement, ForAwaitStatement, ForInStatement, ForOfStatement, ForStatement, WhileStatement);
|
||||
var MemberAssignmentTarget = Union(ComputedMemberAssignmentTarget, StaticMemberAssignmentTarget);
|
||||
var BindingProperty = Union(BindingPropertyIdentifier, BindingPropertyProperty);
|
||||
var MethodDefinition = Union(Getter, Method, Setter);
|
||||
var Program = Union(Module, Script);
|
||||
var VariableReference = Union(AssignmentTargetIdentifier, BindingIdentifier, IdentifierExpression);
|
||||
var NamedObjectProperty = Union(DataProperty, MethodDefinition);
|
||||
var Expression = Union(ArrayExpression, ArrowExpression, AssignmentExpression, AwaitExpression, BinaryExpression, CallExpression, ClassExpression, CompoundAssignmentExpression, ConditionalExpression, FunctionExpression, IdentifierExpression, LiteralBooleanExpression, LiteralInfinityExpression, LiteralNullExpression, LiteralNumericExpression, LiteralRegExpExpression, LiteralStringExpression, MemberExpression, NewExpression, NewTargetExpression, ObjectExpression, TemplateExpression, ThisExpression, UnaryExpression, UpdateExpression, YieldExpression, YieldGeneratorExpression);
|
||||
var Statement = Union(BlockStatement, BreakStatement, ClassDeclaration, ContinueStatement, DebuggerStatement, EmptyStatement, ExpressionStatement, FunctionDeclaration, IfStatement, IterationStatement, LabeledStatement, ReturnStatement, SwitchStatement, SwitchStatementWithDefault, ThrowStatement, TryCatchStatement, TryFinallyStatement, VariableDeclarationStatement, WithStatement);
|
||||
var ObjectProperty = Union(NamedObjectProperty, ShorthandProperty, SpreadProperty);
|
||||
var Node = Union(ArrayAssignmentTarget, ArrayBinding, AssignmentTargetProperty, AssignmentTargetWithDefault, BindingProperty, BindingWithDefault, Block, CatchClause, ClassElement, Directive, ExportDeclaration, ExportFromSpecifier, ExportLocalSpecifier, Expression, FormalParameters, FunctionBody, ImportDeclaration, ImportSpecifier, MemberAssignmentTarget, ObjectAssignmentTarget, ObjectBinding, ObjectProperty, Program, PropertyName, SpreadElement, Statement, Super, SwitchCase, SwitchDefault, TemplateElement, VariableDeclaration, VariableDeclarator, VariableReference);
|
||||
|
||||
ArrayAssignmentTarget.typeName = "ArrayAssignmentTarget";
|
||||
ArrayAssignmentTarget.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ArrayAssignmentTarget" },
|
||||
{ name: "elements", type: List(Maybe(Union(AssignmentTargetWithDefault, Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))))) },
|
||||
{ name: "rest", type: Maybe(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))) }
|
||||
];
|
||||
|
||||
ArrayBinding.typeName = "ArrayBinding";
|
||||
ArrayBinding.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ArrayBinding" },
|
||||
{ name: "elements", type: List(Maybe(Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))))) },
|
||||
{ name: "rest", type: Maybe(Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) }
|
||||
];
|
||||
|
||||
ArrayExpression.typeName = "ArrayExpression";
|
||||
ArrayExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ArrayExpression" },
|
||||
{ name: "elements", type: List(Maybe(Union(Expression, SpreadElement))) }
|
||||
];
|
||||
|
||||
ArrowExpression.typeName = "ArrowExpression";
|
||||
ArrowExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ArrowExpression" },
|
||||
{ name: "isAsync", type: BOOLEAN },
|
||||
{ name: "params", type: FormalParameters },
|
||||
{ name: "body", type: Union(Expression, FunctionBody) }
|
||||
];
|
||||
|
||||
AssignmentExpression.typeName = "AssignmentExpression";
|
||||
AssignmentExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentExpression" },
|
||||
{ name: "binding", type: Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)) },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
AssignmentTargetIdentifier.typeName = "AssignmentTargetIdentifier";
|
||||
AssignmentTargetIdentifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetIdentifier" },
|
||||
{ name: "name", type: STRING }
|
||||
];
|
||||
|
||||
AssignmentTargetPropertyIdentifier.typeName = "AssignmentTargetPropertyIdentifier";
|
||||
AssignmentTargetPropertyIdentifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetPropertyIdentifier" },
|
||||
{ name: "binding", type: AssignmentTargetIdentifier },
|
||||
{ name: "init", type: Maybe(Expression) }
|
||||
];
|
||||
|
||||
AssignmentTargetPropertyProperty.typeName = "AssignmentTargetPropertyProperty";
|
||||
AssignmentTargetPropertyProperty.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetPropertyProperty" },
|
||||
{ name: "name", type: PropertyName },
|
||||
{ name: "binding", type: Union(AssignmentTargetWithDefault, Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))) }
|
||||
];
|
||||
|
||||
AssignmentTargetWithDefault.typeName = "AssignmentTargetWithDefault";
|
||||
AssignmentTargetWithDefault.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "AssignmentTargetWithDefault" },
|
||||
{ name: "binding", type: Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)) },
|
||||
{ name: "init", type: Expression }
|
||||
];
|
||||
|
||||
AwaitExpression.typeName = "AwaitExpression";
|
||||
AwaitExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "AwaitExpression" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
BinaryExpression.typeName = "BinaryExpression";
|
||||
BinaryExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BinaryExpression" },
|
||||
{ name: "left", type: Expression },
|
||||
{ name: "operator", type: BinaryOperator },
|
||||
{ name: "right", type: Expression }
|
||||
];
|
||||
|
||||
BindingIdentifier.typeName = "BindingIdentifier";
|
||||
BindingIdentifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BindingIdentifier" },
|
||||
{ name: "name", type: STRING }
|
||||
];
|
||||
|
||||
BindingPropertyIdentifier.typeName = "BindingPropertyIdentifier";
|
||||
BindingPropertyIdentifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BindingPropertyIdentifier" },
|
||||
{ name: "binding", type: BindingIdentifier },
|
||||
{ name: "init", type: Maybe(Expression) }
|
||||
];
|
||||
|
||||
BindingPropertyProperty.typeName = "BindingPropertyProperty";
|
||||
BindingPropertyProperty.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BindingPropertyProperty" },
|
||||
{ name: "name", type: PropertyName },
|
||||
{ name: "binding", type: Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) }
|
||||
];
|
||||
|
||||
BindingWithDefault.typeName = "BindingWithDefault";
|
||||
BindingWithDefault.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BindingWithDefault" },
|
||||
{ name: "binding", type: Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)) },
|
||||
{ name: "init", type: Expression }
|
||||
];
|
||||
|
||||
Block.typeName = "Block";
|
||||
Block.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Block" },
|
||||
{ name: "statements", type: List(Statement) }
|
||||
];
|
||||
|
||||
BlockStatement.typeName = "BlockStatement";
|
||||
BlockStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BlockStatement" },
|
||||
{ name: "block", type: Block }
|
||||
];
|
||||
|
||||
BreakStatement.typeName = "BreakStatement";
|
||||
BreakStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "BreakStatement" },
|
||||
{ name: "label", type: Maybe(STRING) }
|
||||
];
|
||||
|
||||
CallExpression.typeName = "CallExpression";
|
||||
CallExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "CallExpression" },
|
||||
{ name: "callee", type: Union(Expression, Super) },
|
||||
{ name: "arguments", type: List(Union(Expression, SpreadElement)) }
|
||||
];
|
||||
|
||||
CatchClause.typeName = "CatchClause";
|
||||
CatchClause.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "CatchClause" },
|
||||
{ name: "binding", type: Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)) },
|
||||
{ name: "body", type: Block }
|
||||
];
|
||||
|
||||
ClassDeclaration.typeName = "ClassDeclaration";
|
||||
ClassDeclaration.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ClassDeclaration" },
|
||||
{ name: "name", type: BindingIdentifier },
|
||||
{ name: "super", type: Maybe(Expression) },
|
||||
{ name: "elements", type: List(ClassElement) }
|
||||
];
|
||||
|
||||
ClassElement.typeName = "ClassElement";
|
||||
ClassElement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ClassElement" },
|
||||
{ name: "isStatic", type: BOOLEAN },
|
||||
{ name: "method", type: MethodDefinition }
|
||||
];
|
||||
|
||||
ClassExpression.typeName = "ClassExpression";
|
||||
ClassExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ClassExpression" },
|
||||
{ name: "name", type: Maybe(BindingIdentifier) },
|
||||
{ name: "super", type: Maybe(Expression) },
|
||||
{ name: "elements", type: List(ClassElement) }
|
||||
];
|
||||
|
||||
CompoundAssignmentExpression.typeName = "CompoundAssignmentExpression";
|
||||
CompoundAssignmentExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "CompoundAssignmentExpression" },
|
||||
{ name: "binding", type: Union(AssignmentTargetIdentifier, MemberAssignmentTarget) },
|
||||
{ name: "operator", type: CompoundAssignmentOperator },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
ComputedMemberAssignmentTarget.typeName = "ComputedMemberAssignmentTarget";
|
||||
ComputedMemberAssignmentTarget.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ComputedMemberAssignmentTarget" },
|
||||
{ name: "object", type: Union(Expression, Super) },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
ComputedMemberExpression.typeName = "ComputedMemberExpression";
|
||||
ComputedMemberExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ComputedMemberExpression" },
|
||||
{ name: "object", type: Union(Expression, Super) },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
ComputedPropertyName.typeName = "ComputedPropertyName";
|
||||
ComputedPropertyName.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ComputedPropertyName" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
ConditionalExpression.typeName = "ConditionalExpression";
|
||||
ConditionalExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ConditionalExpression" },
|
||||
{ name: "test", type: Expression },
|
||||
{ name: "consequent", type: Expression },
|
||||
{ name: "alternate", type: Expression }
|
||||
];
|
||||
|
||||
ContinueStatement.typeName = "ContinueStatement";
|
||||
ContinueStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ContinueStatement" },
|
||||
{ name: "label", type: Maybe(STRING) }
|
||||
];
|
||||
|
||||
DataProperty.typeName = "DataProperty";
|
||||
DataProperty.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "DataProperty" },
|
||||
{ name: "name", type: PropertyName },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
DebuggerStatement.typeName = "DebuggerStatement";
|
||||
DebuggerStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "DebuggerStatement" }
|
||||
];
|
||||
|
||||
Directive.typeName = "Directive";
|
||||
Directive.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Directive" },
|
||||
{ name: "rawValue", type: STRING }
|
||||
];
|
||||
|
||||
DoWhileStatement.typeName = "DoWhileStatement";
|
||||
DoWhileStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "DoWhileStatement" },
|
||||
{ name: "body", type: Statement },
|
||||
{ name: "test", type: Expression }
|
||||
];
|
||||
|
||||
EmptyStatement.typeName = "EmptyStatement";
|
||||
EmptyStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "EmptyStatement" }
|
||||
];
|
||||
|
||||
Export.typeName = "Export";
|
||||
Export.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Export" },
|
||||
{ name: "declaration", type: Union(ClassDeclaration, FunctionDeclaration, VariableDeclaration) }
|
||||
];
|
||||
|
||||
ExportAllFrom.typeName = "ExportAllFrom";
|
||||
ExportAllFrom.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExportAllFrom" },
|
||||
{ name: "moduleSpecifier", type: STRING }
|
||||
];
|
||||
|
||||
ExportDefault.typeName = "ExportDefault";
|
||||
ExportDefault.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExportDefault" },
|
||||
{ name: "body", type: Union(ClassDeclaration, Expression, FunctionDeclaration) }
|
||||
];
|
||||
|
||||
ExportFrom.typeName = "ExportFrom";
|
||||
ExportFrom.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExportFrom" },
|
||||
{ name: "namedExports", type: List(ExportFromSpecifier) },
|
||||
{ name: "moduleSpecifier", type: STRING }
|
||||
];
|
||||
|
||||
ExportFromSpecifier.typeName = "ExportFromSpecifier";
|
||||
ExportFromSpecifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExportFromSpecifier" },
|
||||
{ name: "name", type: STRING },
|
||||
{ name: "exportedName", type: Maybe(STRING) }
|
||||
];
|
||||
|
||||
ExportLocalSpecifier.typeName = "ExportLocalSpecifier";
|
||||
ExportLocalSpecifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExportLocalSpecifier" },
|
||||
{ name: "name", type: IdentifierExpression },
|
||||
{ name: "exportedName", type: Maybe(STRING) }
|
||||
];
|
||||
|
||||
ExportLocals.typeName = "ExportLocals";
|
||||
ExportLocals.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExportLocals" },
|
||||
{ name: "namedExports", type: List(ExportLocalSpecifier) }
|
||||
];
|
||||
|
||||
ExpressionStatement.typeName = "ExpressionStatement";
|
||||
ExpressionStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ExpressionStatement" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
ForAwaitStatement.typeName = "ForAwaitStatement";
|
||||
ForAwaitStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ForAwaitStatement" },
|
||||
{ name: "left", type: Union(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)), VariableDeclaration) },
|
||||
{ name: "right", type: Expression },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
ForInStatement.typeName = "ForInStatement";
|
||||
ForInStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ForInStatement" },
|
||||
{ name: "left", type: Union(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)), VariableDeclaration) },
|
||||
{ name: "right", type: Expression },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
ForOfStatement.typeName = "ForOfStatement";
|
||||
ForOfStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ForOfStatement" },
|
||||
{ name: "left", type: Union(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget)), VariableDeclaration) },
|
||||
{ name: "right", type: Expression },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
ForStatement.typeName = "ForStatement";
|
||||
ForStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ForStatement" },
|
||||
{ name: "init", type: Maybe(Union(Expression, VariableDeclaration)) },
|
||||
{ name: "test", type: Maybe(Expression) },
|
||||
{ name: "update", type: Maybe(Expression) },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
FormalParameters.typeName = "FormalParameters";
|
||||
FormalParameters.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "FormalParameters" },
|
||||
{ name: "items", type: List(Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)))) },
|
||||
{ name: "rest", type: Maybe(Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) }
|
||||
];
|
||||
|
||||
FunctionBody.typeName = "FunctionBody";
|
||||
FunctionBody.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "FunctionBody" },
|
||||
{ name: "directives", type: List(Directive) },
|
||||
{ name: "statements", type: List(Statement) }
|
||||
];
|
||||
|
||||
FunctionDeclaration.typeName = "FunctionDeclaration";
|
||||
FunctionDeclaration.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "FunctionDeclaration" },
|
||||
{ name: "isAsync", type: BOOLEAN },
|
||||
{ name: "isGenerator", type: BOOLEAN },
|
||||
{ name: "name", type: BindingIdentifier },
|
||||
{ name: "params", type: FormalParameters },
|
||||
{ name: "body", type: FunctionBody }
|
||||
];
|
||||
|
||||
FunctionExpression.typeName = "FunctionExpression";
|
||||
FunctionExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "FunctionExpression" },
|
||||
{ name: "isAsync", type: BOOLEAN },
|
||||
{ name: "isGenerator", type: BOOLEAN },
|
||||
{ name: "name", type: Maybe(BindingIdentifier) },
|
||||
{ name: "params", type: FormalParameters },
|
||||
{ name: "body", type: FunctionBody }
|
||||
];
|
||||
|
||||
Getter.typeName = "Getter";
|
||||
Getter.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Getter" },
|
||||
{ name: "name", type: PropertyName },
|
||||
{ name: "body", type: FunctionBody }
|
||||
];
|
||||
|
||||
IdentifierExpression.typeName = "IdentifierExpression";
|
||||
IdentifierExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "IdentifierExpression" },
|
||||
{ name: "name", type: STRING }
|
||||
];
|
||||
|
||||
IfStatement.typeName = "IfStatement";
|
||||
IfStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "IfStatement" },
|
||||
{ name: "test", type: Expression },
|
||||
{ name: "consequent", type: Statement },
|
||||
{ name: "alternate", type: Maybe(Statement) }
|
||||
];
|
||||
|
||||
Import.typeName = "Import";
|
||||
Import.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Import" },
|
||||
{ name: "defaultBinding", type: Maybe(BindingIdentifier) },
|
||||
{ name: "namedImports", type: List(ImportSpecifier) },
|
||||
{ name: "moduleSpecifier", type: STRING }
|
||||
];
|
||||
|
||||
ImportNamespace.typeName = "ImportNamespace";
|
||||
ImportNamespace.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ImportNamespace" },
|
||||
{ name: "defaultBinding", type: Maybe(BindingIdentifier) },
|
||||
{ name: "namespaceBinding", type: BindingIdentifier },
|
||||
{ name: "moduleSpecifier", type: STRING }
|
||||
];
|
||||
|
||||
ImportSpecifier.typeName = "ImportSpecifier";
|
||||
ImportSpecifier.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ImportSpecifier" },
|
||||
{ name: "name", type: Maybe(STRING) },
|
||||
{ name: "binding", type: BindingIdentifier }
|
||||
];
|
||||
|
||||
LabeledStatement.typeName = "LabeledStatement";
|
||||
LabeledStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LabeledStatement" },
|
||||
{ name: "label", type: STRING },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
LiteralBooleanExpression.typeName = "LiteralBooleanExpression";
|
||||
LiteralBooleanExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LiteralBooleanExpression" },
|
||||
{ name: "value", type: BOOLEAN }
|
||||
];
|
||||
|
||||
LiteralInfinityExpression.typeName = "LiteralInfinityExpression";
|
||||
LiteralInfinityExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LiteralInfinityExpression" }
|
||||
];
|
||||
|
||||
LiteralNullExpression.typeName = "LiteralNullExpression";
|
||||
LiteralNullExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LiteralNullExpression" }
|
||||
];
|
||||
|
||||
LiteralNumericExpression.typeName = "LiteralNumericExpression";
|
||||
LiteralNumericExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LiteralNumericExpression" },
|
||||
{ name: "value", type: DOUBLE }
|
||||
];
|
||||
|
||||
LiteralRegExpExpression.typeName = "LiteralRegExpExpression";
|
||||
LiteralRegExpExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LiteralRegExpExpression" },
|
||||
{ name: "pattern", type: STRING },
|
||||
{ name: "global", type: BOOLEAN },
|
||||
{ name: "ignoreCase", type: BOOLEAN },
|
||||
{ name: "multiLine", type: BOOLEAN },
|
||||
{ name: "dotAll", type: BOOLEAN },
|
||||
{ name: "unicode", type: BOOLEAN },
|
||||
{ name: "sticky", type: BOOLEAN }
|
||||
];
|
||||
|
||||
LiteralStringExpression.typeName = "LiteralStringExpression";
|
||||
LiteralStringExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "LiteralStringExpression" },
|
||||
{ name: "value", type: STRING }
|
||||
];
|
||||
|
||||
Method.typeName = "Method";
|
||||
Method.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Method" },
|
||||
{ name: "isAsync", type: BOOLEAN },
|
||||
{ name: "isGenerator", type: BOOLEAN },
|
||||
{ name: "name", type: PropertyName },
|
||||
{ name: "params", type: FormalParameters },
|
||||
{ name: "body", type: FunctionBody }
|
||||
];
|
||||
|
||||
Module.typeName = "Module";
|
||||
Module.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Module" },
|
||||
{ name: "directives", type: List(Directive) },
|
||||
{ name: "items", type: List(Union(ExportDeclaration, ImportDeclaration, Statement)) }
|
||||
];
|
||||
|
||||
NewExpression.typeName = "NewExpression";
|
||||
NewExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "NewExpression" },
|
||||
{ name: "callee", type: Expression },
|
||||
{ name: "arguments", type: List(Union(Expression, SpreadElement)) }
|
||||
];
|
||||
|
||||
NewTargetExpression.typeName = "NewTargetExpression";
|
||||
NewTargetExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "NewTargetExpression" }
|
||||
];
|
||||
|
||||
ObjectAssignmentTarget.typeName = "ObjectAssignmentTarget";
|
||||
ObjectAssignmentTarget.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ObjectAssignmentTarget" },
|
||||
{ name: "properties", type: List(AssignmentTargetProperty) },
|
||||
{ name: "rest", type: Maybe(Union(Union(ArrayAssignmentTarget, ObjectAssignmentTarget), Union(AssignmentTargetIdentifier, MemberAssignmentTarget))) }
|
||||
];
|
||||
|
||||
ObjectBinding.typeName = "ObjectBinding";
|
||||
ObjectBinding.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ObjectBinding" },
|
||||
{ name: "properties", type: List(BindingProperty) },
|
||||
{ name: "rest", type: Maybe(Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) }
|
||||
];
|
||||
|
||||
ObjectExpression.typeName = "ObjectExpression";
|
||||
ObjectExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ObjectExpression" },
|
||||
{ name: "properties", type: List(ObjectProperty) }
|
||||
];
|
||||
|
||||
ReturnStatement.typeName = "ReturnStatement";
|
||||
ReturnStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ReturnStatement" },
|
||||
{ name: "expression", type: Maybe(Expression) }
|
||||
];
|
||||
|
||||
Script.typeName = "Script";
|
||||
Script.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Script" },
|
||||
{ name: "directives", type: List(Directive) },
|
||||
{ name: "statements", type: List(Statement) }
|
||||
];
|
||||
|
||||
Setter.typeName = "Setter";
|
||||
Setter.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Setter" },
|
||||
{ name: "name", type: PropertyName },
|
||||
{ name: "param", type: Union(BindingWithDefault, Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding))) },
|
||||
{ name: "body", type: FunctionBody }
|
||||
];
|
||||
|
||||
ShorthandProperty.typeName = "ShorthandProperty";
|
||||
ShorthandProperty.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ShorthandProperty" },
|
||||
{ name: "name", type: IdentifierExpression }
|
||||
];
|
||||
|
||||
SpreadElement.typeName = "SpreadElement";
|
||||
SpreadElement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "SpreadElement" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
SpreadProperty.typeName = "SpreadProperty";
|
||||
SpreadProperty.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "SpreadProperty" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
StaticMemberAssignmentTarget.typeName = "StaticMemberAssignmentTarget";
|
||||
StaticMemberAssignmentTarget.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "StaticMemberAssignmentTarget" },
|
||||
{ name: "object", type: Union(Expression, Super) },
|
||||
{ name: "property", type: STRING }
|
||||
];
|
||||
|
||||
StaticMemberExpression.typeName = "StaticMemberExpression";
|
||||
StaticMemberExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "StaticMemberExpression" },
|
||||
{ name: "object", type: Union(Expression, Super) },
|
||||
{ name: "property", type: STRING }
|
||||
];
|
||||
|
||||
StaticPropertyName.typeName = "StaticPropertyName";
|
||||
StaticPropertyName.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "StaticPropertyName" },
|
||||
{ name: "value", type: STRING }
|
||||
];
|
||||
|
||||
Super.typeName = "Super";
|
||||
Super.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "Super" }
|
||||
];
|
||||
|
||||
SwitchCase.typeName = "SwitchCase";
|
||||
SwitchCase.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "SwitchCase" },
|
||||
{ name: "test", type: Expression },
|
||||
{ name: "consequent", type: List(Statement) }
|
||||
];
|
||||
|
||||
SwitchDefault.typeName = "SwitchDefault";
|
||||
SwitchDefault.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "SwitchDefault" },
|
||||
{ name: "consequent", type: List(Statement) }
|
||||
];
|
||||
|
||||
SwitchStatement.typeName = "SwitchStatement";
|
||||
SwitchStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "SwitchStatement" },
|
||||
{ name: "discriminant", type: Expression },
|
||||
{ name: "cases", type: List(SwitchCase) }
|
||||
];
|
||||
|
||||
SwitchStatementWithDefault.typeName = "SwitchStatementWithDefault";
|
||||
SwitchStatementWithDefault.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "SwitchStatementWithDefault" },
|
||||
{ name: "discriminant", type: Expression },
|
||||
{ name: "preDefaultCases", type: List(SwitchCase) },
|
||||
{ name: "defaultCase", type: SwitchDefault },
|
||||
{ name: "postDefaultCases", type: List(SwitchCase) }
|
||||
];
|
||||
|
||||
TemplateElement.typeName = "TemplateElement";
|
||||
TemplateElement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "TemplateElement" },
|
||||
{ name: "rawValue", type: STRING }
|
||||
];
|
||||
|
||||
TemplateExpression.typeName = "TemplateExpression";
|
||||
TemplateExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "TemplateExpression" },
|
||||
{ name: "tag", type: Maybe(Expression) },
|
||||
{ name: "elements", type: List(Union(Expression, TemplateElement)) }
|
||||
];
|
||||
|
||||
ThisExpression.typeName = "ThisExpression";
|
||||
ThisExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ThisExpression" }
|
||||
];
|
||||
|
||||
ThrowStatement.typeName = "ThrowStatement";
|
||||
ThrowStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "ThrowStatement" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
TryCatchStatement.typeName = "TryCatchStatement";
|
||||
TryCatchStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "TryCatchStatement" },
|
||||
{ name: "body", type: Block },
|
||||
{ name: "catchClause", type: CatchClause }
|
||||
];
|
||||
|
||||
TryFinallyStatement.typeName = "TryFinallyStatement";
|
||||
TryFinallyStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "TryFinallyStatement" },
|
||||
{ name: "body", type: Block },
|
||||
{ name: "catchClause", type: Maybe(CatchClause) },
|
||||
{ name: "finalizer", type: Block }
|
||||
];
|
||||
|
||||
UnaryExpression.typeName = "UnaryExpression";
|
||||
UnaryExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "UnaryExpression" },
|
||||
{ name: "operator", type: UnaryOperator },
|
||||
{ name: "operand", type: Expression }
|
||||
];
|
||||
|
||||
UpdateExpression.typeName = "UpdateExpression";
|
||||
UpdateExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "UpdateExpression" },
|
||||
{ name: "isPrefix", type: BOOLEAN },
|
||||
{ name: "operator", type: UpdateOperator },
|
||||
{ name: "operand", type: Union(AssignmentTargetIdentifier, MemberAssignmentTarget) }
|
||||
];
|
||||
|
||||
VariableDeclaration.typeName = "VariableDeclaration";
|
||||
VariableDeclaration.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclaration" },
|
||||
{ name: "kind", type: VariableDeclarationKind },
|
||||
{ name: "declarators", type: List(VariableDeclarator) }
|
||||
];
|
||||
|
||||
VariableDeclarationStatement.typeName = "VariableDeclarationStatement";
|
||||
VariableDeclarationStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclarationStatement" },
|
||||
{ name: "declaration", type: VariableDeclaration }
|
||||
];
|
||||
|
||||
VariableDeclarator.typeName = "VariableDeclarator";
|
||||
VariableDeclarator.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "VariableDeclarator" },
|
||||
{ name: "binding", type: Union(BindingIdentifier, Union(ArrayBinding, ObjectBinding)) },
|
||||
{ name: "init", type: Maybe(Expression) }
|
||||
];
|
||||
|
||||
WhileStatement.typeName = "WhileStatement";
|
||||
WhileStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "WhileStatement" },
|
||||
{ name: "test", type: Expression },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
WithStatement.typeName = "WithStatement";
|
||||
WithStatement.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "WithStatement" },
|
||||
{ name: "object", type: Expression },
|
||||
{ name: "body", type: Statement }
|
||||
];
|
||||
|
||||
YieldExpression.typeName = "YieldExpression";
|
||||
YieldExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "YieldExpression" },
|
||||
{ name: "expression", type: Maybe(Expression) }
|
||||
];
|
||||
|
||||
YieldGeneratorExpression.typeName = "YieldGeneratorExpression";
|
||||
YieldGeneratorExpression.fields = [
|
||||
{ name: "type", type: Const(TYPE_INDICATOR), value: "YieldGeneratorExpression" },
|
||||
{ name: "expression", type: Expression }
|
||||
];
|
||||
|
||||
return SPEC;
|
||||
}());
|
||||
});
|
||||
|
||||
var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
||||
|
||||
export default __pika_web_default_export_for_treeshaking__;
|
||||
Loading…
Add table
Add a link
Reference in a new issue