From: Jérémie Astor Date: Sun, 22 Nov 2020 22:50:44 +0000 (+0100) Subject: :art: Allow docstr for builtin X-Git-Tag: nightly~1140^2~13 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=b99952be56ed2ecb75dac369f674c4f8def0b4b5;p=gwion.git :art: Allow docstr for builtin --- 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