js-ast-parser
Version:
把javascript代码字符串解析为AST对象
15 lines (14 loc) • 510 B
text/typescript
import { SwitchCaseStatement } from "./SwitchCaseStatement";
import { NodeCode } from "../../constants";
import { Statement } from "./Statement";
import { Expression } from "../expression/Expression";
export class SwitchStatement extends Statement {
type = 'SwitchStatement';
code = NodeCode.SwitchStatement
cases: SwitchCaseStatement[] = [];
discriminant: Expression;
constructor(currentToken: any) {
super();
this.loc.start = currentToken.loc.start;
}
}