Improve handling of nested tokens
This commit is contained in:
parent
770dcdac48
commit
a651c0deea
@ -195,13 +195,18 @@
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
return string.gsub(value, "%%{(.-)}", function(token)
|
-- keep expanding tokens until they are all handled
|
||||||
result, err = expander(token)
|
repeat
|
||||||
if not result then
|
value, count = string.gsub(value, "%%{(.-)}", function(token)
|
||||||
error(err, 0)
|
local result, err = expander(token)
|
||||||
end
|
if not result then
|
||||||
return result
|
error(err, 0)
|
||||||
end)
|
end
|
||||||
|
return result
|
||||||
|
end)
|
||||||
|
until count == 0
|
||||||
|
|
||||||
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user