Skip to content

Invalid lua generated with for, continue, and return #215

Description

@kevinw

This moonscript:

things ={1,nil,2}for thing in*things
if move ==nilcontinueprint(thing)return

Compiles to invalid lua:

localthings= {
1,
nil,
2
}
for_index_0=1, #thingsdolocal_continue_0=falserepeatlocalthing=things[_index_0]
ifmove==nilthen_continue_0=truebreakendprint(thing)
return_continue_0=trueuntiltrueifnot_continue_0thenbreakendend

The error:

lua: bug.lua:16: 'until' expected (to close 'repeat' at line 8) near '='

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions