PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org/docs/Introduction
MIT License
337 stars 20 forks source link

Allow fallthrough on empty cases #866

Closed Sainan closed 1 month ago

Sainan commented 1 month ago

It's a bit strange, but there's no logical reason for why it should be a parse error. Fixes #859.

XmiliaH commented 1 month ago

How about:

switch 1 do
    case 1:
        --[[@fallthrough]]
    default:
end

and I think this allows

switch 1 do
        --[[@fallthrough]]
    case 1:
end