The Parser
This commit is contained in:
parent
a5ce0fd020
commit
fd9866e963
@ -416,6 +416,27 @@ function grab_p1_butts()
|
||||
}
|
||||
end
|
||||
|
||||
-->8
|
||||
-- the parser
|
||||
|
||||
parser = {}
|
||||
mknew(parser)
|
||||
|
||||
function parser:ingest(str)
|
||||
for row in all(split(str, "\n")) do
|
||||
local prev = {}
|
||||
local sectors = split(row, ":")
|
||||
for i=1,#sectors,2 do
|
||||
local x = self[sectors[i]](self, prev, usplit(sectors[i+1]))
|
||||
if (x) add(prev, x)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function parser:saveas(prev, name, sel)
|
||||
self[name] = sel and prev[sel] or prev
|
||||
end
|
||||
|
||||
-->8
|
||||
--ship behavior
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user