From 3ba67b839f6028b9120936f8ccb53e4a770bb20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Reuh=20Fildadut?= Date: Wed, 29 May 2024 14:30:34 +0200 Subject: [PATCH] [stdlib] add is typed --- anselme/stdlib/typed.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/anselme/stdlib/typed.lua b/anselme/stdlib/typed.lua index 3df406d..f026fec 100644 --- a/anselme/stdlib/typed.lua +++ b/anselme/stdlib/typed.lua @@ -1,5 +1,5 @@ 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 { { @@ -14,6 +14,12 @@ return { end }, + { + "is typed", "(value)", + function(state, v) + return Boolean:new(v.type == "typed") + end, + }, { "type", "(value)", function(state, v)