From 28921e9a7674179bd8c1bc985ce987e95d995b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 28 Jun 2011 10:52:50 +0200 Subject: [PATCH] Update PaperScript to work with new parse-js and beautify code so that line numbers in error messages remain correct. --- src/core/PaperScript.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index 1ddd340c..e4ac817b 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -88,8 +88,8 @@ var PaperScript = this.PaperScript = new function() { // Use parse-js to translate the code into a AST structure which is then // walked and parsed for operators to overload. The resulting AST is // translated back to code and evaluated. - var ast = parse_js.parse(code), - walker = parse_js.walker(), + var ast = parse_js.parse(code, true), + walker = parse_js.ast_walker(), walk = walker.walk; ast = walker.with_walkers({ @@ -125,7 +125,7 @@ var PaperScript = this.PaperScript = new function() { return walk(ast); }); - return parse_js.stringify(ast, true); + return parse_js.gen_code(ast, true); } function evaluate(code, scope) {