(grammar-seq grammar)
Return a map of all grammar paths to grammar nodes.
Return a map of all grammar paths to grammar nodes.
(load-grammar ebnf)
Takes an EBNF grammar test string and returns an instacheck grammar (via parser->grammar).
Takes an EBNF grammar test string and returns an instacheck grammar (via parser->grammar).
(parse-grammar-comments grammar & [tx])
Takes a grammar, reads edn maps from comments in the grammar and returns a map of grammar paths to parsed comment data. Multiple comments with edn maps at the same path will be merged into a single map. If the optional tx function is provided it will be applied to the merge maps values.
This requires a patched version of instaparse to retain the comments in the grammar on :comments keys.
Takes a grammar, reads edn maps from comments in the grammar and returns a map of grammar paths to parsed comment data. Multiple comments with edn maps at the same path will be merged into a single map. If the optional tx function is provided it will be applied to the merge maps values. This requires a patched version of instaparse to retain the comments in the grammar on :comments keys.
(parser->grammar parser)
Takes a instaparse parser and returns an instacheck grammar: the :grammar value from the parser with a metadata map containing the start rule (:start).
Takes a instaparse parser and returns an instacheck grammar: the :grammar value from the parser with a metadata map containing the start rule (:start).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close