lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

The attached file contains modified Lua 5 parser and lexer files with
added `continue' keyword. In addition, both `break' and `continue'
statements may have optional integer argument specifying which loop is
to be broken or continued. For example:

for i = 1, 10 do
    for j = 1, 10 do
        for k = 1, 10 do
            break -- breaks `for k' loop
            break 1 -- breaks `for k' loop
            break 2 -- breaks `for j' loop
            break 3 -- breaks `for i' loop
            break 4 -- error, no loop to break
            continue 2 -- continues `for j' loop
            ...
        end
    end
end

Compared with the version I posted previously, this is a bug fix
version (upvalues were not closed properly - thanks to Rici for
finding the bug).

Regards,
Leszek

Attachment: cont2.tar.gz
Description: GNU Zip compressed data