diff options
Diffstat (limited to 'schmooz.scm')
-rwxr-xr-x[-rw-r--r--] | schmooz.scm | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/schmooz.scm b/schmooz.scm index 39785f3..55103b9 100644..100755 --- a/schmooz.scm +++ b/schmooz.scm @@ -306,22 +306,32 @@ #\!)) '("deffn {Procedure}" "deffnx {Procedure}" "deffn") '("defun" "defunx" "defun")))))) + (define in-body? #f) (out-header args (car ops)) (let loop ((xdefs xdefs)) (cond ((pair? xdefs) (out-header (car xdefs) (cadr ops)) (loop (cdr xdefs))))) (for-each (lambda (subl) + ;;(print 'in-body? in-body? 'subl subl) (out 0 (car subl)) (for-each (lambda (l) (case (car l) ((@dfn) (out-cindex (cadr l))) ((@args) - (out-header - (cons (car args) (cdr l)) - (cadr ops))))) - (cdr subl))) + (cond + (in-body? + (out 0 "@end " (caddr ops)) + (set! in-body? #f) + (out-header (cons (car args) (cdr l)) + (car ops))) + (else + (out-header (cons (car args) (cdr l)) + (cadr ops))))))) + (cdr subl)) + (if (not (equal? "" (car subl))) + (set! in-body? #t))) (map (lambda (bl) (substitute-macs bl mac-list)) body)) @@ -344,9 +354,7 @@ (else (report "bad macro" l)))) (cdr subl))) - (map (lambda (bl) - (substitute-macs bl mac-list)) - body)) + (map (lambda (bl) (substitute-macs bl mac-list)) body)) (out 0 "@end defvar") (out 0))) |