lua-users home
lua-l archive

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


Pierre-Yves Gérardy wrote:
> Since almost none came spontaneously:
> 
> Feed back is most welcome!
> -- Pierre-Yves

I tried it with the test suite of my JSON module [1] and I got an error
that an argument to a match time capture was nil.

The error appears to be that LuLPeg stops processing additional
arguments after encountering nil:

    function cargtest(m, g)
      g.match(g.Cmt(g.Carg(1) * g.Carg(2) * g.Carg(3), print), "", 1,
        m, nil, {})
    end

    cargtest("lulpeg", require "lulpeg")
    cargtest("lpeg", require "lpeg")

The above test case produces the following output:

    1  lulpeg
    1  lpeg    nil  table: 0x24a1280

If I pass some other value instead of nil as argument, my test suite
passes successfully.  Just the big array test took an unusual long time
-- it is parsing "["..("0,"):rep(100000).."0]".  But the tests
completed, so good job on the module!

Best regards,

David Kolf


[1] <http://dkolf.de/src/dkjson-lua.fsl/>