matcher->pretty-string

This commit is contained in:
Tony Garnock-Jones 2014-06-17 17:15:34 -04:00
parent 5057103681
commit 867afdbf63
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,7 @@
?!
(struct-out capture)
pretty-print-matcher
matcher->pretty-string
matcher-key-set
matcher-key-set/single
projection->pattern

View File

@ -39,6 +39,7 @@
;; Printing and Serialization
pretty-print-matcher
matcher->pretty-string
matcher->jsexpr
jsexpr->matcher
@ -51,7 +52,7 @@
(require racket/set)
(require racket/match)
(require (only-in racket/port call-with-output-string))
(require (only-in racket/port call-with-output-string with-output-to-string))
(require (only-in racket/class object?))
(require rackunit)
@ -869,6 +870,9 @@
(newline port)
m)
(define (matcher->pretty-string m #:indent [initial-indent 0])
(with-output-to-string (lambda () (pretty-print-matcher m #:indent initial-indent))))
;; Matcher (Value -> JSExpr) -> JSExpr
;; Serializes a matcher to a JSON expression.
(define (matcher->jsexpr m success->jsexpr)