passing the funky comment test

This commit is contained in:
Jeremy Ashkenas 2010-02-12 16:26:28 -05:00
parent 1a6194e9f0
commit 4deabf5e01
3 changed files with 8 additions and 3 deletions

View File

@ -474,7 +474,8 @@
statement: true
});
}), o("Comment TERMINATOR When", function() {
return $3.comment = $1;
$3.comment = $1;
return $3;
})
],
// The most basic form of "if".

View File

@ -370,7 +370,10 @@ case 173:this.$ = new IfNode($$[$0-4+2-1], $$[$0-4+3-1], null, {
statement: true
});
break;
case 174:this.$ = $$[$0-3+3-1].comment = $$[$0-3+1-1];
case 174:this.$ = (function () {
$$[$0-3+3-1].comment = $$[$0-3+1-1];
return $$[$0-3+3-1];
}());
break;
case 175:this.$ = new IfNode($$[$0-3+2-1], $$[$0-3+3-1]);
break;

View File

@ -406,7 +406,8 @@ grammar: {
When: [
o "LEADING_WHEN SimpleArgs Block", -> new IfNode($2, $3, null, {statement: true})
o "LEADING_WHEN SimpleArgs Block TERMINATOR", -> new IfNode($2, $3, null, {statement: true})
o "Comment TERMINATOR When", -> $3.comment: $1
o "Comment TERMINATOR When", ->
$3.comment: $1; $3
]
# The most basic form of "if".