js-ast-parser
Version:
把javascript代码字符串解析为AST对象
16 lines (15 loc) • 468 B
text/typescript
import { Block } from "../../Block";
import { NodeCode } from "../../constants";
import { AstNode } from "../AstNode";
import { Statement } from "./Statement";
export class IfStatement extends Statement {
type = 'IfStatement';
code = NodeCode.IfStatement;
test: AstNode;
alternate: IfStatement | Block;
consequent: Block;
constructor(currentToken: any) {
super();
this.loc.start = currentToken.loc.start;
}
}