Print empty gestalt differently to reduce ambiguity.

This commit is contained in:
Tony Garnock-Jones 2014-05-22 18:49:26 -04:00
parent 052c90ef78
commit cbf057204c
1 changed files with 9 additions and 7 deletions

View File

@ -256,13 +256,15 @@
(gestalt-matcher-transform g (lambda (m) (matcher-relabel m (lambda (v) pidset))))) (gestalt-matcher-transform g (lambda (m) (matcher-relabel m (lambda (v) pidset)))))
(define (pretty-print-gestalt g [port (current-output-port)]) (define (pretty-print-gestalt g [port (current-output-port)])
(for [(metalevel (in-naturals)) (ls (in-list (gestalt-metalevels g)))] (if (gestalt-empty? g)
(for [(level (in-naturals)) (p (in-list ls))] (fprintf port "EMPTY GESTALT\n")
(match-define (cons subs advs) p) (for [(metalevel (in-naturals)) (ls (in-list (gestalt-metalevels g)))]
(when (or subs advs) (for [(level (in-naturals)) (p (in-list ls))]
(fprintf port "GESTALT metalevel ~v level ~v:\n" metalevel level) (match-define (cons subs advs) p)
(when subs (fprintf port " - subs:") (pretty-print-matcher subs port #:indent 9)) (when (or subs advs)
(when advs (fprintf port " - advs:") (pretty-print-matcher advs port #:indent 9)))))) (fprintf port "GESTALT metalevel ~v level ~v:\n" metalevel level)
(when subs (fprintf port " - subs:") (pretty-print-matcher subs port #:indent 9))
(when advs (fprintf port " - advs:") (pretty-print-matcher advs port #:indent 9)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;