~dieggsy/chalk

4c44c91cf120c5d2ff3b66a2b1e75739967ce352 — dieggsy 3 years ago 2b71816
Add support for parameters
1 files changed, 9 insertions(+), 2 deletions(-)

M chalk-bin.scm
M chalk-bin.scm => chalk-bin.scm +9 -2
@@ 116,13 116,13 @@
        (when @example
          (document-script (cons '(@highlight "scheme") @example)))))))

(define (document-variable exp)
(define (document-variable exp #!optional (type 'constant))
  (let* ((name (second exp))
         (doc (fourth exp))
         (internal (find-tag '@internal doc))
         (docstr (find-docstr doc)))
    (unless internal
      (printf "<constant>~s</constant>\n" name)
      (printf "<~a>~s</~a>\n" type name type)
      (when (and docstr (not (string-null? docstr)))
        (printf "~a\n\n" docstr)))))



@@ 164,6 164,9 @@
(define syntax-tags
  '(macro syntax))

(define parameter-tags
  '(param parameter))

(define file-relpath)
(define (document-expr exp)
  (define documentable-expr?


@@ 186,6 189,10 @@
                         (pair? (second exp)))))
           (document-procedure exp))
          ((and documentable-expr?
                (tagged exp parameter-tags)
                (eqv? 'define (car exp)))
           (document-variable exp 'parameter))
          ((and documentable-expr?
                (eqv? 'define (car exp)))
           (document-variable exp))
          ((and documentable-expr?