feat(AstTranformer): add support for missing nodes

This commit is contained in:
Victor Berchet 2015-06-10 11:55:11 +02:00
parent 7d32879929
commit da60381c89
1 changed files with 8 additions and 3 deletions

View File

@ -410,11 +410,16 @@ export class AstTransformer implements AstVisitor {
return res;
}
visitChain(ast: Chain) { throw new BaseException('Not implemented'); }
visitChain(ast: Chain) { return new Chain(this.visitAll(ast.expressions)); }
visitAssignment(ast: Assignment) { throw new BaseException('Not implemented'); }
visitAssignment(ast: Assignment) {
return new Assignment(ast.target.visit(this), ast.value.visit(this));
}
visitIf(ast: If) { throw new BaseException('Not implemented'); }
visitIf(ast: If) {
let falseExp = isPresent(ast.falseExp) ? ast.falseExp.visit(this) : null;
return new If(ast.condition.visit(this), ast.trueExp.visit(this), falseExp);
}
}
var _evalListCache = [