Модуль:Песочница/Pok: различия между версиями

Нет описания правки
мНет описания правки
Строка 105: Строка 105:


-- Обработка таблиц
-- Обработка таблиц
getTableOutput = function(tableId)
getTableOutput = function(tableId, visited)
    visited = visited or {}
 
    if visited[tableId] then
        return ''
    end
 
    visited[tableId] = true
 
     local tableData = loadData('User:IanComradeBot/prototypes/table.json')
     local tableData = loadData('User:IanComradeBot/prototypes/table.json')
     local tableDataIndex = findDataById(buildIndex(tableData), tableId)
     local tableDataIndex = findDataById(buildIndex(tableData), tableId)
Строка 112: Строка 120:


     if tableDataIndex['!type:GroupSelector'] then
     if tableDataIndex['!type:GroupSelector'] then
         return handleGroupSelector(tableDataIndex['!type:GroupSelector'])
         return handleGroupSelector(tableDataIndex['!type:GroupSelector'], visited)
     elseif tableDataIndex['!type:AllSelector'] then
     elseif tableDataIndex['!type:AllSelector'] then
         return processNestedSelectors(tableDataIndex['!type:AllSelector'].children)
         return processNestedSelectors(tableDataIndex['!type:AllSelector'].children, visited)
     end
     end