added print_to_string helper method
This commit is contained in:
@@ -296,6 +296,12 @@ function OutputStream(options) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AST_Node.DEFMETHOD("print_to_string", function(options){
|
||||||
|
var s = OutputStream(options);
|
||||||
|
this.print(s);
|
||||||
|
return s.get();
|
||||||
|
});
|
||||||
|
|
||||||
function PARENS(nodetype, func) {
|
function PARENS(nodetype, func) {
|
||||||
nodetype.DEFMETHOD("needs_parens", func);
|
nodetype.DEFMETHOD("needs_parens", func);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user