Added `check-requires'.

This commit is contained in:
Eli Barzilay 2011-08-26 10:57:30 -04:00
parent e67415171a
commit 89096b8838

View File

@ -1076,6 +1076,24 @@
(begin (printf "; Syntax set\n") (current-syntax stx)) (begin (printf "; Syntax set\n") (current-syntax stx))
(cmderror "internal error: ~s ~s" stx (syntax? stx)))]))) (cmderror "internal error: ~s ~s" stx (syntax? stx)))])))
(defautoload macro-debugger/analysis/check-requires show-requires)
(defcommand (check-requires ckreq) "[<simple-module-spec>]"
"check the `require's of a module"
["Uses `macro-debugger/analysis/check-requires', see the docs for more"
"information."]
(define mod (syntax->datum (getarg 'modspec #:default here-mod-or-eof)))
(define rs (show-requires mod))
(wrapped-output
(for ([decision (in-list '(keep bypass drop))])
(define all (filter (λ (x) (eq? decision (car x))) rs))
(unless (null? all)
(define names (map cadr all))
;; doesn't print the phase number (third element of all members)
(printf "; ~a: ~a"
(string-titlecase (symbol->string decision)) (car names))
(for ([n (in-list (cdr names))]) (printf ", ~a" n))
(printf ".\n")))))
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
;; dynamic log output control ;; dynamic log output control