2023-05-22 12:55:46 +00:00
|
|
|
export const ECMA_VERSION = 11;
|
|
|
|
|
|
2023-05-26 11:42:10 +00:00
|
|
|
/* Indicates the mode the code should be parsed in.
|
2023-05-22 12:55:46 +00:00
|
|
|
This influences global strict mode and parsing of import and export declarations.
|
|
|
|
|
*/
|
|
|
|
|
export enum SourceType {
|
|
|
|
|
script = "script",
|
|
|
|
|
module = "module",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Each node has an attached type property which further defines
|
|
|
|
|
// what all properties can the node have.
|
|
|
|
|
// We will just define the ones we are working with
|
|
|
|
|
export enum NodeTypes {
|
|
|
|
|
Identifier = "Identifier",
|
|
|
|
|
AssignmentPattern = "AssignmentPattern",
|
|
|
|
|
Literal = "Literal",
|
|
|
|
|
Property = "Property",
|
|
|
|
|
// Declaration - https://github.com/estree/estree/blob/master/es5.md#declarations
|
|
|
|
|
FunctionDeclaration = "FunctionDeclaration",
|
|
|
|
|
ExportDefaultDeclaration = "ExportDefaultDeclaration",
|
|
|
|
|
VariableDeclarator = "VariableDeclarator",
|
|
|
|
|
// Expression - https://github.com/estree/estree/blob/master/es5.md#expressions
|
|
|
|
|
MemberExpression = "MemberExpression",
|
|
|
|
|
FunctionExpression = "FunctionExpression",
|
|
|
|
|
ArrowFunctionExpression = "ArrowFunctionExpression",
|
2023-07-24 06:53:45 +00:00
|
|
|
AssignmentExpression = "AssignmentExpression",
|
2023-05-22 12:55:46 +00:00
|
|
|
ObjectExpression = "ObjectExpression",
|
|
|
|
|
ArrayExpression = "ArrayExpression",
|
|
|
|
|
ThisExpression = "ThisExpression",
|
|
|
|
|
CallExpression = "CallExpression",
|
|
|
|
|
BinaryExpression = "BinaryExpression",
|
|
|
|
|
ExpressionStatement = "ExpressionStatement",
|
|
|
|
|
BlockStatement = "BlockStatement",
|
2023-05-26 11:42:10 +00:00
|
|
|
ConditionalExpression = "ConditionalExpression",
|
|
|
|
|
AwaitExpression = "AwaitExpression",
|
2023-05-22 12:55:46 +00:00
|
|
|
}
|