From 55cac2397676029069099fc3dec046571d7443de Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 10 Mar 2010 20:15:12 -0500 Subject: [PATCH] fixing indentation for prefix while nodes --- lib/grammar.js | 2 +- lib/nodes.js | 2 +- lib/parser.js | 2 +- src/grammar.coffee | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/grammar.js b/lib/grammar.js index 28ce4ccf..5d3f4f91 100644 --- a/lib/grammar.js +++ b/lib/grammar.js @@ -392,7 +392,7 @@ While: [o("WhileSource Block", function() { return $1.add_body($2); }), o("Expression WhileSource", function() { - return $2.add_body($1); + return $2.add_body(Expressions.wrap([$1])); }) ], // Array, object, and range comprehensions, at the most generic level. diff --git a/lib/nodes.js b/lib/nodes.js index bf984ff8..99caaf43 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -89,7 +89,7 @@ idt = this.tab || ''; num = (tabs || 0) + 1; while (num -= 1) { -idt += TAB + idt += TAB; } return idt; }; diff --git a/lib/parser.js b/lib/parser.js index e5966fd4..57301c22 100755 --- a/lib/parser.js +++ b/lib/parser.js @@ -257,7 +257,7 @@ case 122:this.$ = new WhileNode($$[$0-4+2-1], { break; case 123:this.$ = $$[$0-2+1-1].add_body($$[$0-2+2-1]); break; -case 124:this.$ = $$[$0-2+2-1].add_body($$[$0-2+1-1]); +case 124:this.$ = $$[$0-2+2-1].add_body(Expressions.wrap([$$[$0-2+1-1]])); break; case 125:this.$ = new ForNode($$[$0-4+1-1], $$[$0-4+4-1], $$[$0-4+3-1][0], $$[$0-4+3-1][1]); break; diff --git a/src/grammar.coffee b/src/grammar.coffee index 9fa908da..6916b4b0 100644 --- a/src/grammar.coffee +++ b/src/grammar.coffee @@ -371,7 +371,7 @@ grammar: { # or postfix, with a single expression. There is no do..while. While: [ o "WhileSource Block", -> $1.add_body $2 - o "Expression WhileSource", -> $2.add_body $1 + o "Expression WhileSource", -> $2.add_body Expressions.wrap [$1] ] # Array, object, and range comprehensions, at the most generic level.