matcher->pretty-string
This commit is contained in:
parent
5057103681
commit
867afdbf63
|
@ -21,6 +21,7 @@
|
||||||
?!
|
?!
|
||||||
(struct-out capture)
|
(struct-out capture)
|
||||||
pretty-print-matcher
|
pretty-print-matcher
|
||||||
|
matcher->pretty-string
|
||||||
matcher-key-set
|
matcher-key-set
|
||||||
matcher-key-set/single
|
matcher-key-set/single
|
||||||
projection->pattern
|
projection->pattern
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
;; Printing and Serialization
|
;; Printing and Serialization
|
||||||
pretty-print-matcher
|
pretty-print-matcher
|
||||||
|
matcher->pretty-string
|
||||||
matcher->jsexpr
|
matcher->jsexpr
|
||||||
jsexpr->matcher
|
jsexpr->matcher
|
||||||
|
|
||||||
|
@ -51,7 +52,7 @@
|
||||||
|
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
(require racket/match)
|
(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 (only-in racket/class object?))
|
||||||
|
|
||||||
(require rackunit)
|
(require rackunit)
|
||||||
|
@ -869,6 +870,9 @@
|
||||||
(newline port)
|
(newline port)
|
||||||
m)
|
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
|
;; Matcher (Value -> JSExpr) -> JSExpr
|
||||||
;; Serializes a matcher to a JSON expression.
|
;; Serializes a matcher to a JSON expression.
|
||||||
(define (matcher->jsexpr m success->jsexpr)
|
(define (matcher->jsexpr m success->jsexpr)
|
||||||
|
|
Loading…
Reference in New Issue