LiveScript icon indicating copy to clipboard operation
LiveScript copied to clipboard

`case then if Expr then Expr` screws up in a `switch`

Open summivox opened this issue 9 years ago • 2 comments

switch 0
case 1 then if 2 then 3

compiles to

switch (0) {
case 1:
  if (2) {
    3;
  }
}

while

switch 0
case 1 then if 2 then 3
case 4 then 5

errors

Parse error on line 2: Unexpected 'CASE'

but

switch 0
case 1 then
  if 2 then 3
case 4 then 5

compiles to

switch (0) {
case 1:
  if (2) {
    3;
  }
  break;
case 4:
  5;
}

(then after case 1 is optional; both works)

summivox avatar Aug 04 '16 23:08 summivox

That's really just https://github.com/satyr/coco/issues/131, again.

vendethiel avatar Jan 11 '18 14:01 vendethiel

#139

vendethiel avatar Jan 17 '18 12:01 vendethiel