1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 17:19:31 +00:00

First test batch and associated fixes

The test runner is also nicer to use.
This commit is contained in:
Étienne Fildadut 2023-12-28 16:51:18 +01:00
parent 10084dec23
commit 82ce53be83
154 changed files with 1586 additions and 78 deletions

View file

@ -49,13 +49,13 @@ List = ast.abstract.Runtime {
get = function(self, state, index)
local list = self.branched:get(state)
if index < 0 then index = #list.list + 1 + index end
if index > #list.list or index == 0 then error("list index out of bounds") end
if index > #list.list or index == 0 then error("list index out of bounds", 0) end
return list.list[index]
end,
set = function(self, state, index, val)
local list = self:_prepare_branch(state)
if index < 0 then index = #list.list + 1 + index end
if index > #list.list or index == 0 then error("list index out of bounds") end
if index > #list.list+1 or index == 0 then error("list index out of bounds", 0) end
list.list[index] = val
end,
insert = function(self, state, val)