(define xtmdoc-globalvar-handler
(lambda (name-sym)
(list
'(category . "global var")
(cons 'name (symbol->string name-sym))
(list 'args)
;; rememeber that global vars need to be "depointerised" by one level
(cons 'type (impc:ir:pretty-print-type (impc:ir:pointer-- (impc:ti:get-globalvar-type (symbol->string name-sym)))))
(cons 'docstring
(let ((docstring (impc:ti:get-globalvar-docstring (symbol->string name-sym))))
(if (string=? docstring "") '() docstring))))))