Implement fixed length arrays
This commit is contained in:
17
splubp.p8
17
splubp.p8
@@ -195,6 +195,14 @@ function splubp:write_shr(n)
|
||||
self:wnx(n)
|
||||
end
|
||||
|
||||
function splubp:write_a(tbl)
|
||||
self:write_c(#tbl)
|
||||
local rpt = self.cri
|
||||
for item in all(tbl) do
|
||||
self.cri = rpt
|
||||
self:wnx(item)
|
||||
end
|
||||
end
|
||||
-->8
|
||||
-- loader
|
||||
|
||||
@@ -217,3 +225,12 @@ function splubp:shr()
|
||||
local amt = self:op()
|
||||
return self:rnx() >>> amt
|
||||
end
|
||||
|
||||
function splubp:a()
|
||||
local ret,rpt = {},self.cri
|
||||
for i = 1,self:c() do
|
||||
self.cri=rpt
|
||||
add(ret, self:rnx())
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
Reference in New Issue
Block a user