PromucFlow_constructor/app/shared/ast/src/constants.ts
Ayangade Adeoluwa 3de00c6bf4
feat: Extraction of AST Logic (#15892)
* POC for Shared AST Logic using Yarn Symlinks

* fix: preinstall script for bundling shared packages

* Merge commit

* fix: updated the script to link, unlink the package as shared dep

* fix: updated dependencies

* Add a post-install script and fix yarn.lock file

* Remove commented code

* fix: added verification script, readme, moved scripts to shared

* Extraction of AST Logic into shared/ast folder

* Add jest test script

* Replace hardcoded ast Logic use with Shared AST module

* Replace parse code with getAST

Co-authored-by: Aman Agarwal <aman@appsmith.com>
2022-08-23 16:39:42 +05:30

31 lines
1.1 KiB
TypeScript

export const ECMA_VERSION = 11;
/* Indicates the mode the code should be parsed in.
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",
ObjectExpression = "ObjectExpression",
ArrayExpression = "ArrayExpression",
ThisExpression = "ThisExpression",
}