mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
First test batch and associated fixes
The test runner is also nicer to use.
This commit is contained in:
parent
10084dec23
commit
82ce53be83
154 changed files with 1586 additions and 78 deletions
|
|
@ -21,9 +21,8 @@ return {
|
|||
"_~_", "(condition, expression)", function(state, condition, expression)
|
||||
ensure_if_variable(state)
|
||||
if condition:truthy() then
|
||||
local r = expression:call(state, ArgumentTuple:new())
|
||||
set_if_variable(state, true)
|
||||
return r
|
||||
return expression:call(state, ArgumentTuple:new())
|
||||
else
|
||||
set_if_variable(state, false)
|
||||
return Nil:new()
|
||||
|
|
@ -37,9 +36,8 @@ return {
|
|||
if last_if_success(state) then
|
||||
return Nil:new()
|
||||
else
|
||||
local r = expression:call(state, ArgumentTuple:new())
|
||||
set_if_variable(state, true)
|
||||
return r
|
||||
return expression:call(state, ArgumentTuple:new())
|
||||
end
|
||||
end
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
local ast = require("ast")
|
||||
local Tuple, Table, Struct, ArgumentTuple = ast.Tuple, ast.Table, ast.Struct, ast.ArgumentTuple
|
||||
local Tuple, Table, Struct, ArgumentTuple, Nil = ast.Tuple, ast.Table, ast.Struct, ast.ArgumentTuple, ast.Nil
|
||||
|
||||
local tag_manager = require("state.tag_manager")
|
||||
|
||||
|
|
@ -14,6 +14,8 @@ return {
|
|||
tags_struct = tags
|
||||
elseif Table:is(tags) then
|
||||
tags_struct = tags:to_struct(state)
|
||||
elseif Nil:is(tags) then
|
||||
tags_struct = Struct:new()
|
||||
else
|
||||
tags_struct = Struct:from_tuple(Tuple:new(tags)):eval(state)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue