1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Omit function variables from merge

This commit is contained in:
Étienne Fildadut 2021-12-10 19:43:06 +01:00
parent 40c1616cce
commit 3d32f35d67
7 changed files with 70 additions and 45 deletions

View file

@ -1,4 +1,7 @@
local identifier_pattern
--- replace values recursively in table t according to to_replace ([old table] = new table)
-- already_replaced is a temporary table to avoid infinite loop & duplicate processing, no need to give it
local function replace_in_table(t, to_replace, already_replaced)
already_replaced = already_replaced or {}
already_replaced[t] = true
@ -56,8 +59,12 @@ common = {
for _, m in ipairs(copied_to_replace) do
replace_in_table(m, not_modified)
end
-- replace
-- replace in t
replace_in_table(t, to_replace)
end
}
package.loaded[...] = common
identifier_pattern = require((...):gsub("common$", "parser.common")).identifier_pattern
return common