mherkender / lua.js

An ECMAscript framework to compile and run Lua code, allowing Lua to run in a browser or in Flash
http://blog.brokenfunction.com/
600 stars 73 forks source link

Semicolon should be allowed after return statement #28

Closed elisee closed 11 years ago

elisee commented 11 years ago

The grammar doesn't allow having a semicolon after a return statement, although it should.

I suspect the fix is fairly straightforward but I'm very much unfamiliar with the grammar definition syntax so I have no idea how to allow an optional ";" token.

mherkender commented 11 years ago

You're correct, return (and break) is handled slightly differently than other statements, and support for semicolons just wasn't there.

Anyway, it was a pretty straightforward fix, but it works for me now. Thanks for the report!

elisee commented 11 years ago

Awesome, thanks for the fix :)