aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-11-14 05:10:19 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2023-11-16 00:51:19 +0100
commitb7c7b062aa09d88b9cb4ea8e881f48a584287033 (patch)
treec802b1f26ad9a6977aee0fa6f20f25f23b420753
parentLimit coverage to only use half of all threads by default. (diff)
downloadcalp-b7c7b062aa09d88b9cb4ea8e881f48a584287033.tar.gz
calp-b7c7b062aa09d88b9cb4ea8e881f48a584287033.tar.xz
Remove (vcomponent util describe).
Vcomponent's 'write' method is now good enough for debug printing, removing the need for this quasi-formatted output.
-rw-r--r--module/calp/main.scm2
-rw-r--r--module/vcomponent/util/describe.scm46
2 files changed, 1 insertions, 47 deletions
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 9bc8cdf8..1f0f3ed9 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -189,5 +189,5 @@ zoneinfo database, but is currently broken.</p>")
;; and prints them.
(map (lambda (it)
(with-output-to-port (current-error-port)
- (lambda () ((@ (vcomponent util describe) describe) it))))
+ (lambda () (write it))))
(filter-stack (@ (vcomponent) vcomponent?) (make-stack #t))))))
diff --git a/module/vcomponent/util/describe.scm b/module/vcomponent/util/describe.scm
deleted file mode 100644
index ab020d6e..00000000
--- a/module/vcomponent/util/describe.scm
+++ /dev/null
@@ -1,46 +0,0 @@
-(define-module (vcomponent util describe)
- :use-module (hnh util)
- :use-module ((srfi srfi-1) :select (car+cdr))
- :use-module (srfi srfi-71)
- :use-module (vcomponent base)
- :use-module (text util)
- :export (describe))
-
-(define* (describe vcomponent optional: (indent 0))
- (define ii (make-string indent #\space))
- (define iii (make-string (1+ indent) #\space))
-
- (define maxlen (find-max (map
- (lambda (a) (string-length (symbol->string a)))
- (map car (properties vcomponent)))))
-
- (format #t "~aBEGIN ~a~%" ii (type vcomponent))
-
- (for-each (lambda (kv)
- (let ((key values (car+cdr kv)))
- (define (out vline)
- (format #t "~a~a = ~a"
- iii
- (trim-to-width (symbol->string key) maxlen)
- (trim-to-width
- (format #f "~a" (value vline))
- (- 80 indent maxlen)))
- (awhen (vline-source vline)
- (display ((@@ (vcomponent formats ical parse) get-line) it)))
- (unless (null? (parameters vline))
- (display " ;")
- (for (key value) in (parameters vline)
- (format #t " ~a=~a" key value)))
- (newline))
- (if (list? values)
- (for-each out values)
- (out values))))
- (sort* (properties vcomponent)
- string<?
- ;; TODO is key always a symbol?
- (compose symbol->string car)))
-
- (for child in (children vcomponent)
- (describe child (+ indent 2)))
-
- (format #t "~aEND ~a~%" ii (type vcomponent)))