Модуль:Сущность: различия между версиями

мНет описания правки
Нет описания правки
Строка 260: Строка 260:
     local whitelist = parseListArg(args.whitelist or "")
     local whitelist = parseListArg(args.whitelist or "")
     local hasWhitelist = next(whitelist) ~= nil
     local hasWhitelist = next(whitelist) ~= nil
    local ignoreComponents = args.ignoreComponents or args.ignoreComponent or ""
    local ignorePrototypes = args.ignorePrototypes or args.ignorePrototype or ""


     local componentDefs = load_module_data("component.json")
     local componentDefs = load_module_data("component.json")
Строка 292: Строка 295:
                 foundPrototypes[n] = true
                 foundPrototypes[n] = true
             end
             end
        end
    end
    if ignoreComponents ~= "" then
        for item in string.gmatch(ignoreComponents, "[^,]+") do
            local name = trim(item)
            if name ~= "" then foundComponents[name] = nil end
        end
    end
    if ignorePrototypes ~= "" then
        for item in string.gmatch(ignorePrototypes, "[^,]+") do
            local name = trim(item)
            if name ~= "" then foundPrototypes[name] = nil end
         end
         end
     end
     end
Строка 554: Строка 570:
             end
             end


             local keyStr = tostring(k)
             local PEER = "\31\31"
             keyStr = apply_pattern(keyStr, keyPattern, keyReplace)
             local keyStr0 = apply_pattern(tostring(k), keyPattern, (keyReplace or "\\1"):gsub("\\2", PEER))
             vStr = apply_pattern(vStr, valuePattern, valueReplace)
             local vStr0 = apply_pattern(vStr, valuePattern, (valueReplace or "\\1"):gsub("\\2", PEER))
            local keyStr = tostring(keyStr0):gsub(PEER, tostring(vStr0))
            vStr = tostring(vStr0):gsub(PEER, tostring(keyStr0))


             if vStr ~= "" then
             if vStr ~= "" then