]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] Add T.callable() type to lua_shape
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 18 Nov 2025 11:09:22 +0000 (11:09 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 18 Nov 2025 11:09:22 +0000 (11:09 +0000)
commitc0662b8dd3f4b4fe12c2ebcf075287508ec23319
treeb1b44e90522ede27cf62a93435d3ef54977c4b27
parent4e4c25f61d4a28f71e4c2d95f19cf424ac564fb6
[Feature] Add T.callable() type to lua_shape

Add function/callable type validator to lua_shape core.

Implementation:
- check_callable(): Validates value is of type 'function'
- T.callable(opts): Constructor for callable type
- Returns type_mismatch error if value is not a function

This was missing from the initial implementation and is needed by
lua_meta.lua which validates callback functions in metafunction schemas.

Documentation added to README.md scalar types section.
lualib/lua_shape/README.md
lualib/lua_shape/core.lua