This commit is contained in:
MihailRis 2026-10-06 21:31:02 +03:00
parent d4d6235b2b
commit 0b52369ed9

View file

@ -62,25 +62,15 @@ local function parse_simple_frames(line, node)
end
end
local function parse_track(root)
local raw_track = {
duration = math.huge,
fps = DEFAULT_FPS,
linesets = {},
curves = {},
}
local function parse_directive(node, raw_track)
local linesets = raw_track.linesets
for i, node in ipairs(root) do
if type(node) == "string" then
goto continue
end
local tag = node['#']
if tag == "configure" then
parse_configure(raw_track, node)
goto continue
return
elseif tag == "curve" then
raw_track.curves[node.name] = node
goto continue
return
end
local target_type = nil
@ -118,7 +108,19 @@ local function parse_track(root)
end
table.insert(lineset.lines, line)
::continue::
end
local function parse_track(root)
local raw_track = {
duration = math.huge,
fps = DEFAULT_FPS,
linesets = {},
curves = {},
}
for i, node in ipairs(root) do
if type(node) == 'table' then
parse_directive(node, raw_track)
end
end
return raw_track
end