Skip to content

Instantly share code, notes, and snippets.

@SammyIsra
Last active July 2, 2019 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SammyIsra/cf5cf8130bc418229ff9342bc7a5c677 to your computer and use it in GitHub Desktop.
Save SammyIsra/cf5cf8130bc418229ff9342bc7a5c677 to your computer and use it in GitHub Desktop.
Types associated with the Transformed AST Nodes
interface ExpressionStatementNode {
type: "ExpressionStatement";
expression: TransformedCallExpressionNode;
}
interface TransformedCallExpressionNode {
type: CallExpressionNode["type"];
callee: IdentifierNode;
arguments: (TransformedCallExpressionNode | NumberLiteralNode | StringLiteralNode)[];
}
interface IdentifierNode {
type: "Identifier";
name: string;
}
/** The AST root node. It can only be of type "Program" */
interface TransformedAST {
type: "Program";
body: ExpressionStatementNode[];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment