Coffeescript: unexpected then in a switch statement
Just drop the then
altogether. You only need it when you don't want to have a new indented block.
tag = 0 switch tag when 0 alert "0" when 1 alert "1"
(if
works that way, too)