allowing terminator/comment as a block, so that you can have comment-only blocks

This commit is contained in:
Jeremy Ashkenas 2010-03-10 16:18:17 -05:00
parent ccb7f63b8a
commit 2a47727641
4 changed files with 167 additions and 151 deletions

View File

@ -75,6 +75,8 @@
return $2;
}), o("INDENT OUTDENT", function() {
return new Expressions();
}), o("TERMINATOR Comment", function() {
return Expressions.wrap([$2]);
})
],
// A literal identifier, a variable name or property.

File diff suppressed because one or more lines are too long

View File

@ -98,6 +98,7 @@ grammar: {
Block: [
o "INDENT Expressions OUTDENT", -> $2
o "INDENT OUTDENT", -> new Expressions()
o "TERMINATOR Comment", -> Expressions.wrap [$2]
]
# A literal identifier, a variable name or property.

View File

@ -23,4 +23,15 @@ else if NaN
else
true
ok result
ok result
# If statement with a comment-only clause.
result: if false
# comment
else
27
ok result is 27