elseif line.data:match('%[ u250c') then
local section_name = line.data:match('u250c%s*(.*)')
elseif line.data:match('%] u2518') then
local section_name = line.data:match('] u2518%s*(.*)')
if array.find(Section_stack, function(x) return x.name == section_name end) then
while table.remove(Section_stack).name ~= section_name do
--
end
line.section_end = true
line.section_name = section_name
line.data = nil
end
line.section_stack = table.shallowcopy(Section_stack)
else
-- string
line.section_stack = table.shallowcopy(Section_stack)
end
else
line.section_stack = {}
end
end
end
function table.shallowcopy(x)
return {unpack(x)}
table.insert(Section_stack, {name=section_name})
line.section_begin = true
line.section_name = section_name
line.data = nil
line.section_stack = table.shallowcopy(Section_stack) -- as it is at the beginning