mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Update PaperScript to work with new parse-js and beautify code so that line numbers in error messages remain correct.
This commit is contained in:
parent
dcc7d29726
commit
28921e9a76
1 changed files with 3 additions and 3 deletions
|
@ -88,8 +88,8 @@ var PaperScript = this.PaperScript = new function() {
|
||||||
// Use parse-js to translate the code into a AST structure which is then
|
// 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
|
// walked and parsed for operators to overload. The resulting AST is
|
||||||
// translated back to code and evaluated.
|
// translated back to code and evaluated.
|
||||||
var ast = parse_js.parse(code),
|
var ast = parse_js.parse(code, true),
|
||||||
walker = parse_js.walker(),
|
walker = parse_js.ast_walker(),
|
||||||
walk = walker.walk;
|
walk = walker.walk;
|
||||||
|
|
||||||
ast = walker.with_walkers({
|
ast = walker.with_walkers({
|
||||||
|
@ -125,7 +125,7 @@ var PaperScript = this.PaperScript = new function() {
|
||||||
return walk(ast);
|
return walk(ast);
|
||||||
});
|
});
|
||||||
|
|
||||||
return parse_js.stringify(ast, true);
|
return parse_js.gen_code(ast, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function evaluate(code, scope) {
|
function evaluate(code, scope) {
|
||||||
|
|
Loading…
Reference in a new issue