A library that loads and wraps pod-babashka-instaparse.
This library can be safely included on your classpath alongside the regular
instaparse without causing issues for
JVM Clojure, since it only has .bb
files which do not conflict with .clj
files.
Add this library to your bb.edn
in the :deps
map:
io.github.babashka/instaparse-bb {:git/sha "<latest-sha>"}
Replace <latest-sha>
with the latest SHA of this repo or use a tagged version.
Only a subset of instaparse is exposed. If you are missing functionality, please create an issue.
parser
parse
parses
failure?
transform
defparser
none for currently exposed functionality
(require '[instaparse.core :as insta])
(def as-and-bs
(insta/parser
"S = AB*
AB = A B
A = 'a'+
B = 'b'+"))
(prn (insta/parse as-and-bs "aaaaabbbaaaabb"))
(prn (as-and-bs "aaaaabbbaaaabb"))
(def failure (insta/parse as-and-bs "xaaaaabbbaaaabb"))
(prn failure)
(prn :failure? (insta/failure? failure))
Copyright © 2023 Michiel Borkent
Distributed under the EPL 1.0 license, same as Instaparse and Clojure. See LICENSE.