[prev in list] [next in list] [prev in thread] [next in thread]
List: lua-l
Subject: Re: lpeg-list and nested substitutions
From: Wesley Smith <wesley.hoke () gmail ! com>
Date: 2010-03-28 10:30:29
Message-ID: 1079b051003280330m24403e4cte348e71bfbeb7d6d () mail ! gmail ! com
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic