enabling condition-less switches.

This commit is contained in:
Jeremy Ashkenas
2010-05-10 22:57:51 -04:00
parent 4d0acc9b02
commit cd6ee373ff
4 changed files with 84 additions and 65 deletions

View File

@@ -469,6 +469,8 @@ grammar: {
Switch: [
o "SWITCH Expression INDENT Whens OUTDENT", -> $4.switches_over $2
o "SWITCH Expression INDENT Whens ELSE Block OUTDENT", -> $4.switches_over($2).add_else $6, true
o "SWITCH INDENT Whens OUTDENT", -> $3
o "SWITCH INDENT Whens ELSE Block OUTDENT", -> $3.add_else $5, true
]
# The inner list of whens is left recursive. At code-generation time, the