lua-users home
lua-l archive

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


> Thanks, I completely overlooked this!!
> 
> But being able running the test does not seem to solve all problems. I carefully removed all other lpeg.so versions from my path, but test.lua gives the following error:
> 
> /usr/local/bin/lua: ./test.lua:24: assertion failed!
> stack traceback:
> 	[C]: in function 'assert'
> 	./test.lua:24: in function 'checkeq'
> 	./test.lua:27: in function 'checkeq'
> 	./test.lua:26: in function 'checkeq'
> 	./test.lua:26: in function 'checkeq'
> 	./test.lua:1099: in main chunk
> 	[C]: in ?
> The 1099 line is the check on tables.
> 
> I added statements for printing at the error:
> local function checkeq (x, y, p)
> local p = true
> print ("type(x)",type(x),"type(y)",type(y))
> if p then print(x,y) end
> ..
> 
> and the result is:
> type(x)	string	type(y)	nil
> 	nil
> and then the same error of course.

Can you find the keys that generated this error (that is, the values
of 'k' in the stacked invocations of 'checkeq')?

Also, please check this: the test you are running looks like this
test.lua:1090:
---------------------------------
t= p:match[[
1
  1.1
  1.2
    1.2.1
    
2
  2.1
]]
checkeq(t, {"1", {"1.1", "1.2", {"1.2.1", "", ident = "    "}, ident = "  "},
            "2", {"2.1", ident = "  "}, ident = ""})
---------------------------------

The line just after '1.2.1' should have exactly four empty spaces.
Maybe when you edited the file the editor changed it.

-- Roberto