lua-users home
lua-l archive

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


To partially answer my own question, here's a solution I came up with:

local p = P{
	"patt",
	one = Cmt(L(L"one"), function(s, i)
				s[i] = "two"
				return i
			end),
	patt = (V"one" + L(V"patt") + P(1))^0
}

My guess is this is the best way to go.  Here's what happens:

{
    [1] = something
    2 = {
        [1] = something
        2 = {
            [1] = one
        }
    }
    3 = {
        [1] = one
    }
}


Becomes:

{
    [1] = something
    2 = {
        [1] = something
        [2] = two
    }
    [3] = two
}


wes