js-ast-parser
Version:
把javascript代码字符串解析为AST对象
17 lines (14 loc) • 414 B
text/typescript
import { NodeCode } from "../../constants";
import { Expression } from "./Expression";
export class BinaryExpression extends Expression {
type = 'BinaryExpression';
code = NodeCode.BinaryExpression;
operator: string;
right: Expression;
constructor(public left?: Expression) {
super();
if (left) {
this.loc.start = left.loc.start;
}
}
}