aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/describe.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-21 16:17:28 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-22 22:58:30 +0100
commitd00fea566004e67161ee45246b239fff5d416b0e (patch)
tree5641c0c0d0e78b046b6045ed2440512f12259560 /module/vcomponent/describe.scm
parentComplete rewrite of use2dot (diff)
downloadcalp-d00fea566004e67161ee45246b239fff5d416b0e.tar.gz
calp-d00fea566004e67161ee45246b239fff5d416b0e.tar.xz
Cleanup modules.
Primarly this moves all vcompenent input and output code to clearly labeled modules, instead of being spread out. At the same time it also removes a handfull of unused procedures.
Diffstat (limited to 'module/vcomponent/describe.scm')
-rw-r--r--module/vcomponent/describe.scm44
1 files changed, 0 insertions, 44 deletions
diff --git a/module/vcomponent/describe.scm b/module/vcomponent/describe.scm
deleted file mode 100644
index af0f9433..00000000
--- a/module/vcomponent/describe.scm
+++ /dev/null
@@ -1,44 +0,0 @@
-(define-module (vcomponent describe)
- :use-module (calp util)
- :use-module (vcomponent base)
- :use-module (text util))
-
-(define*-public (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) 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 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)))