From 67228c0dc9a317891c6a701a8fa034071289aa6b Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 16 Mar 2026 12:34:59 -0500 Subject: [PATCH] xo-interpreter2 stack: + more primitive function-type decoration --- include/xo/type/Metatype.hpp | 6 +++++- src/type/Metatype.cpp | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/xo/type/Metatype.hpp b/include/xo/type/Metatype.hpp index 0b0aeef..8f7fc62 100644 --- a/include/xo/type/Metatype.hpp +++ b/include/xo/type/Metatype.hpp @@ -48,6 +48,9 @@ namespace xo { /** any numeric type: i16|i32|i64|f32|f64 **/ t_numeric, + /** any callable type (e.g. all function types) **/ + t_callable, + /* any type at all */ t_any, }; @@ -71,10 +74,11 @@ namespace xo { static Metatype t_array() { return Metatype(code::t_array); } static Metatype t_function() { return Metatype(code::t_function); } static Metatype t_struct() { return Metatype(code::t_struct); } - static Metatype t_dict() { return Metatype(code::t_dict); } + static Metatype t_dict() { return Metatype(code::t_dict); } static Metatype t_integer() { return Metatype(code::t_integer); } static Metatype t_numeric() { return Metatype(code::t_numeric); } + static Metatype t_callable() { return Metatype(code::t_callable); } static Metatype t_any() { return Metatype(code::t_any); } /** description string for this type category **/ diff --git a/src/type/Metatype.cpp b/src/type/Metatype.cpp index be42f61..aa1a1bb 100644 --- a/src/type/Metatype.cpp +++ b/src/type/Metatype.cpp @@ -32,6 +32,7 @@ namespace xo { case code::t_integer: return "integer"; case code::t_numeric: return "numeric"; + case code::t_callable: return "callable"; case code::t_any: return "any"; } } @@ -77,6 +78,8 @@ namespace xo { return true; case code::t_numeric: return true; + case code::t_callable: + return true; case code::t_any: return true; }