WurstScript
WurstScript copied to clipboard
enhance switch
like kotlin
switch foo
case 1
//todo exist like now
case 2 -> //todo but in one line like closure
in 3..5
//todo when foo >= 3 and foo <= 5
not in 1..10
//todo when foo < 1 or foo > 10
case 6|8|80
// todo when foo equals 6 or 8 or 80
if this mod 2 == 0
// todo when foo mod 2 == 0
or// 'or' or 'else'
//like default but short
only support integer is enoughed
because it use with object-type-id usually
of course some features can support other type like string and enum