Add patch->pretty-string

This commit is contained in:
Tony Garnock-Jones 2015-03-05 16:40:25 +00:00
parent fb5a39d3af
commit 97016c5696
1 changed files with 8 additions and 6 deletions

View File

@ -25,7 +25,8 @@
biased-intersection biased-intersection
view-patch view-patch
pretty-print-patch) pretty-print-patch
patch->pretty-string)
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
@ -141,12 +142,13 @@
(biased-intersection (patch-removed p) interests))) (biased-intersection (patch-removed p) interests)))
(define (pretty-print-patch p [port (current-output-port)]) (define (pretty-print-patch p [port (current-output-port)])
(display (patch->pretty-string p) port))
(define (patch->pretty-string p)
(match-define (patch in out) p) (match-define (patch in out) p)
(fprintf port "<<<<<<<< Removed:\n") (format "<<<<<<<< Removed:\n~a======== Added:\n~a>>>>>>>>\n"
(pretty-print-matcher out port) (matcher->pretty-string out)
(fprintf port "======== Added:\n") (matcher->pretty-string in)))
(pretty-print-matcher in port)
(fprintf port ">>>>>>>>\n"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;