allowing comments in the middle of switch statements

This commit is contained in:
Jeremy Ashkenas
2010-01-09 13:25:44 -05:00
parent 2319affa61
commit 8e3922b6c6
3 changed files with 15 additions and 4 deletions

View File

@@ -385,7 +385,7 @@ rule
LEADING_WHEN Expression Block { result = IfNode.new(val[1], val[2], nil, {:statement => true}) }
| LEADING_WHEN Expression Block
Terminator { result = IfNode.new(val[1], val[2], nil, {:statement => true}) }
| Comment
| Comment Terminator When { result = val[2].add_comment(val[0]) }
;
# The most basic form of "if".