|
Here's an even more reduced case:
local newline = P"\r"^-1 * "\n" / function (a) print("newline"); end
local incrementline = Cg ( Cb"linenum" / function ( a ) print("incrementline"); return a + 1 end , "linenum" )local test = (setup * newline * incrementline):match("\n")
local setup = Cg ( Cc ( 1) , "linenum" )
test:match("\n")
Produces:
newline
Why doesn't incrementline do anything when it matches? (Incidentally, I've just tried the example where I got this pattern from and it doesn't work. :( )