1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

[stdlib] add is typed

This commit is contained in:
Étienne Fildadut 2024-05-29 14:30:34 +02:00
parent 02fa9d075d
commit 3ba67b839f

View file

@ -1,5 +1,5 @@
local ast = require("anselme.ast") local ast = require("anselme.ast")
local ArgumentTuple, String, Typed = ast.ArgumentTuple, ast.String, ast.Typed local ArgumentTuple, String, Typed, Boolean = ast.ArgumentTuple, ast.String, ast.Typed, ast.Boolean
return { return {
{ {
@ -14,6 +14,12 @@ return {
end end
}, },
{
"is typed", "(value)",
function(state, v)
return Boolean:new(v.type == "typed")
end,
},
{ {
"type", "(value)", "type", "(value)",
function(state, v) function(state, v)