Small cleanup
This commit is contained in:
@@ -340,8 +340,11 @@ function OutputStream(options) {
|
|||||||
/* -----[ utils ]----- */
|
/* -----[ utils ]----- */
|
||||||
|
|
||||||
function DEFPRINT(nodetype, generator) {
|
function DEFPRINT(nodetype, generator) {
|
||||||
nodetype.DEFMETHOD("print", function(stream, force_parens){
|
nodetype.DEFMETHOD("_codegen", generator);
|
||||||
var self = this;
|
};
|
||||||
|
|
||||||
|
AST_Node.DEFMETHOD("print", function(stream, force_parens){
|
||||||
|
var self = this, generator = self._codegen;
|
||||||
stream.push_node(self);
|
stream.push_node(self);
|
||||||
if (force_parens || self.needs_parens(stream)) {
|
if (force_parens || self.needs_parens(stream)) {
|
||||||
stream.with_parens(function(){
|
stream.with_parens(function(){
|
||||||
@@ -356,7 +359,6 @@ function OutputStream(options) {
|
|||||||
}
|
}
|
||||||
stream.pop_node();
|
stream.pop_node();
|
||||||
});
|
});
|
||||||
};
|
|
||||||
|
|
||||||
AST_Node.DEFMETHOD("print_to_string", function(options){
|
AST_Node.DEFMETHOD("print_to_string", function(options){
|
||||||
var s = OutputStream(options);
|
var s = OutputStream(options);
|
||||||
@@ -902,7 +904,7 @@ function OutputStream(options) {
|
|||||||
DEFPRINT(AST_New, function(self, output){
|
DEFPRINT(AST_New, function(self, output){
|
||||||
output.print("new");
|
output.print("new");
|
||||||
output.space();
|
output.space();
|
||||||
AST_Call.prototype.print.call(self, output);
|
AST_Call.prototype._codegen(self, output);
|
||||||
});
|
});
|
||||||
|
|
||||||
AST_Seq.DEFMETHOD("_do_print", function(output){
|
AST_Seq.DEFMETHOD("_do_print", function(output){
|
||||||
|
|||||||
Reference in New Issue
Block a user