From 33b1679d75f2a3a5dac053431a41897ebf96a3f3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 24 Aug 2020 13:11:56 +0200 Subject: Allow primops to have Markdown documentation --- src/libexpr/primops.hh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libexpr/primops.hh') diff --git a/src/libexpr/primops.hh b/src/libexpr/primops.hh index 75c460ecf..ed5e2ea58 100644 --- a/src/libexpr/primops.hh +++ b/src/libexpr/primops.hh @@ -10,9 +10,11 @@ struct RegisterPrimOp struct Info { std::string name; - size_t arity; - PrimOpFun primOp; + std::vector args; + size_t arity = 0; + const char * doc; std::optional requiredFeature; + PrimOpFun fun; }; typedef std::vector PrimOps; @@ -26,6 +28,8 @@ struct RegisterPrimOp size_t arity, PrimOpFun fun, std::optional requiredFeature = {}); + + RegisterPrimOp(Info && info); }; /* These primops are disabled without enableNativeCode, but plugins -- cgit v1.2.3