Currently, the parser stops parsing statements entirely when it reaches a return or break statement. While this is correct behavior in terms of Lua syntax, it can lead to very messy syntax errors afterwards.
Instead the parser should continue parsing statements as usual, but show a separate diagnostic pointing out that they cannot appear after return or break statements.
Currently, the parser stops parsing statements entirely when it reaches a
returnorbreakstatement. While this is correct behavior in terms of Lua syntax, it can lead to very messy syntax errors afterwards.Instead the parser should continue parsing statements as usual, but show a separate diagnostic pointing out that they cannot appear after
returnorbreakstatements.