fixing indentation for prefix while nodes

This commit is contained in:
Jeremy Ashkenas 2010-03-10 20:15:12 -05:00
parent b9f1390405
commit 55cac23976
4 changed files with 4 additions and 4 deletions

View File

@ -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.

View File

@ -89,7 +89,7 @@
idt = this.tab || '';
num = (tabs || 0) + 1;
while (num -= 1) {
idt += TAB
idt += TAB;
}
return idt;
};

View File

@ -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;

View File

@ -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.