emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-gauche 5876bc2 018/119: Deal with dotted signatures


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-gauche 5876bc2 018/119: Deal with dotted signatures in autodoc
Date: Sun, 1 Aug 2021 18:27:49 -0400 (EDT)

branch: elpa/geiser-gauche
commit 5876bc20adf3e1e755d56015a467f5b18281ec10
Author: András Simonyi <andras.simonyi@gmail.com>
Commit: András Simonyi <andras.simonyi@gmail.com>

    Deal with dotted signatures in autodoc
---
 geiser.scm | 45 +++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/geiser.scm b/geiser.scm
index 879283e..80b9d35 100644
--- a/geiser.scm
+++ b/geiser.scm
@@ -90,22 +90,35 @@
        `(,id))))
 
 (define (process-info info)
-  (let* ((required '("required"))
-        (optional '("optional"))
-        (key '("key"))
-        (section :required))
-    (dolist (x (cdr info))
-           (case x
-             ((:optional :key) (set! section x))
-             ((:rest))
-             (else (case section
-                     ((:optional) (push! optional x))
-                     ((:key) (push! key x))
-                     (else (push! required x))))))
-    `(,(car info) ("args"
-                  ,(map (cut reverse <>)
-                        (list required optional key)))
-      ("module" user))))
+  `(,(car info)
+    ("args"
+     ,(if (list? info)
+         (let* ((required '("required"))
+                (optional '("optional"))
+                (key '("key"))
+                (section :required))
+           (dolist (x (cdr info))
+                   (case x
+                     ((:optional :key) (set! section x))
+                     ((:rest))
+                     (else (case section
+                             ((:optional) (push! optional x))
+                             ((:key) (push! key x))
+                             (else (if (symbol=? x 'args)
+                                       (push! required "...")
+                                       (push! required x)))))))
+
+           (map (cut reverse <>)
+                (list required optional key)))
+         `(("required" ,@(process-dotted-info (cdr info)) "...")
+           ("optional")
+           ("key"))))
+    ("module" user)))
+
+(define (process-dotted-info info)
+  (if (pair? (cdr info))
+      (cons (car info) (process-dotted-info (cdr info)))
+      (list (car info))))
 
 ;; Further
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]