diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-05 15:26:37 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-05 15:26:37 +0200 |
commit | 99285f865b352ce0658cca3cd4845995af4ea71d (patch) | |
tree | 998ed2e32c09f5c2941f19ca62f982473adc16f3 /scheme/racket/geiser/autodoc.rkt | |
parent | f0ff37dc07075298043a8b5319867d355f41a773 (diff) | |
download | geiser-chez-99285f865b352ce0658cca3cd4845995af4ea71d.tar.gz geiser-chez-99285f865b352ce0658cca3cd4845995af4ea71d.tar.bz2 |
Racket: better autodoc for syntax forms
Diffstat (limited to 'scheme/racket/geiser/autodoc.rkt')
-rw-r--r-- | scheme/racket/geiser/autodoc.rkt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scheme/racket/geiser/autodoc.rkt b/scheme/racket/geiser/autodoc.rkt index 0bb850d..ac66da9 100644 --- a/scheme/racket/geiser/autodoc.rkt +++ b/scheme/racket/geiser/autodoc.rkt @@ -98,10 +98,10 @@ (`(define-syntax-rule (,name . ,formals) . ,_) (add-signature! name formals store)) (`(define-syntax ,name (syntax-rules ,specials . ,clauses)) - (for-each (lambda (c) (add-signature! name (cdar c) store)) + (for-each (lambda (c) (add-syntax-signature! name (cdar c) store)) (reverse clauses))) (`(define-syntax ,name (lambda ,_ (syntax-case ,_ . ,clauses))) - (for-each (lambda (c) (add-signature! name (cdar c) store)) + (for-each (lambda (c) (add-syntax-signature! name (cdar c) store)) (reverse clauses))) (_ void)))) @@ -112,6 +112,13 @@ (cons (parse-formals formals) (hash-ref store name '()))))) +(define (add-syntax-signature! name formals store) + (when (symbol? name) + (hash-set! store + name + (cons (make-signature formals '() '() #f) + (hash-ref store name '()))))) + (define (parse-formals formals) (let loop ((formals formals) (req '()) (opt '()) (keys '())) (cond ((null? formals) |