From b99952be56ed2ecb75dac369f674c4f8def0b4b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 22 Nov 2020 23:50:44 +0100 Subject: [PATCH] :art: Allow docstr for builtin --- include/gwi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/gwi.h b/include/gwi.h index d20124fd..352d4408 100644 --- a/include/gwi.h +++ b/include/gwi.h @@ -17,4 +17,10 @@ static inline Tmpl* gwi_tmpl(const Gwi gwi) { } ANN m_bool gwi_run(const Gwion gwion, m_bool (*f)(const Gwi)); + +ANN static inline m_bool gwi_doc(const Gwi gwi, const m_str name, const m_str doc) { + DECL_OB(const Value, v, = nspc_lookup_value0(gwi->gwion->env->curr, insert_symbol(gwi->gwion->st, name))) + v->docstr = new_text(gwi->gwion->mp); + text_add(v->docstr, doc); +} #endif -- 2.43.0