summaryrefslogtreecommitdiff
path: root/scheme/guile
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-03 00:02:36 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-03 00:02:36 +0100
commitd2afd2b7f9f793962dd0f949461851ae8be2649b (patch)
treef802ab61103b6c96f1b5c193042022f4bfe121e8 /scheme/guile
parent95e744b614398b2955143121e7b5da5748e833ee (diff)
downloadgeiser-chez-d2afd2b7f9f793962dd0f949461851ae8be2649b.tar.gz
geiser-chez-d2afd2b7f9f793962dd0f949461851ae8be2649b.tar.bz2
Fix autodoc support for multiline arities in documentation.
Diffstat (limited to 'scheme/guile')
-rw-r--r--scheme/guile/geiser/doc.scm21
1 files changed, 13 insertions, 8 deletions
diff --git a/scheme/guile/geiser/doc.scm b/scheme/guile/geiser/doc.scm
index f446fde..175fe19 100644
--- a/scheme/guile/geiser/doc.scm
+++ b/scheme/guile/geiser/doc.scm
@@ -143,9 +143,10 @@
(define (doc->args doc)
(define proc-rx "-- Scheme Procedure: ([^[\n]+)\n")
- (define proc-rx2 "-- Scheme Procedure: ([^[\n]+\\[[^\n]*(\n[\n]+]+)?)")
+ (define proc-rx2 "-- Scheme Procedure: ([^[\n]+\\[[^\n]*(\n[^\n]+\\]+)?)")
(and doc
- (let ((match (or (string-match proc-rx doc) (string-match proc-rx2 doc))))
+ (let ((match (or (string-match proc-rx doc)
+ (string-match proc-rx2 doc))))
(and match (parse-signature-string (match:substring match 1))))))
(define (parse-signature-string str)
@@ -155,11 +156,12 @@
(if (< (length tokens) 2)
'()
(let loop ((tokens (cdr tokens)) (req '()) (opt '()) (rest #f))
- (cond ((null? tokens) `((required ,@(map string->symbol (reverse! req)))
- (optional ,@(map string->symbol (reverse! opt)))
- ,@(if rest
- (list (cons 'rest (string->symbol rest)))
- '())))
+ (cond ((null? tokens)
+ `((required ,@(map string->symbol (reverse! req)))
+ (optional ,@(map string->symbol (reverse! opt)))
+ ,@(if rest
+ (list (cons 'rest (string->symbol rest)))
+ '())))
((string=? "." (car tokens))
(if (not (null? (cdr tokens)))
(loop (cddr tokens) req opt (cadr tokens))
@@ -167,7 +169,10 @@
((or (string-match opt-arg-rx (car tokens))
(string-match opt-arg-rx2 (car tokens)))
=> (lambda (m)
- (loop (cdr tokens) req (cons (match:substring m 1) opt) rest)))
+ (loop (cdr tokens)
+ req
+ (cons (match:substring m 1) opt)
+ rest)))
(else (loop (cdr tokens) (cons (car tokens) req) opt rest)))))))
(define (generic-args gen)