Contract profiler: support incomplete blame objects.

This commit is contained in:
Vincent St-Amour 2014-01-08 16:53:41 -05:00
parent cc0e67638c
commit 7495243d34
2 changed files with 12 additions and 2 deletions

View File

@ -191,7 +191,7 @@
(printf "~a[label=\"~a\"][color=\"~a\"]\n"
(hash-ref nodes->names n)
n
(if (hash-ref nodes->typed? n) "green" "red")))
(if (hash-ref nodes->typed? n #f) "green" "red")))
(for ([(k v) (in-hash edge-samples)])
(match-define (cons pos neg) k)
(printf "~a -> ~a[label=\"~ams\"]\n"

View File

@ -1,6 +1,6 @@
#lang racket/base
(require racket/port)
(require racket/port racket/contract)
(provide (all-defined-out))
@ -33,3 +33,13 @@
(with-output-to-file file
#:exists 'replace
(lambda () body ...))))
;; for debugging
(define (print-blame b)
(printf (string-append "#<blame positive=~a\n"
" negative=~a\n"
" contract=~a\n"
" value=~a\n"
" source=~a>\n")
(blame-positive b) (blame-negative b)
(blame-contract b) (blame-value b) (blame-source b)))