matcher->pretty-string
This commit is contained in:
parent
5057103681
commit
867afdbf63
|
@ -21,6 +21,7 @@
|
|||
?!
|
||||
(struct-out capture)
|
||||
pretty-print-matcher
|
||||
matcher->pretty-string
|
||||
matcher-key-set
|
||||
matcher-key-set/single
|
||||
projection->pattern
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue