Liking cljdoc? Tell your friends :D

instacheck.codegen


apply-grammar-updatesclj

(apply-grammar-updates grammar grammar-updates)

Replace the generators in the grammar as defined by the list of {:path PATH :value VALUE} maps in grammar-updates. Find each :path in a grammar and replace it with :value (using specter's setval). This allows us to replace generators in the grammar with references to other generators (such as real generators from a Clojure namespace).

Replace the generators in the grammar as defined by the list of
{:path PATH :value VALUE} maps in grammar-updates. Find each :path
in a grammar and replace it with :value (using specter's setval).
This allows us to replace generators in the grammar with references
to other generators (such as real generators from a Clojure
namespace).
raw docstring

eval-generator-sourceclj

(eval-generator-source src)

grammar->generator-defs-sourceclj

(grammar->generator-defs-source {:keys [start] :as ctx} grammar)

Takes an grammar (loaded using load-grammar) and returns the text of a namespace with top-level defines (defs) for all the rules. If the :start is specified in the ctx then this the name of the rule to use as the starting rule of the grammar. If :start is not specified then the first rule in the grammar file is used as the starting rule. Only the start rule flattens the generated values into a final string.

Takes an grammar (loaded using load-grammar) and returns the text
of a namespace with top-level defines (defs) for all the rules. If
the :start is specified in the ctx then this the name of the rule to
use as the starting rule of the grammar. If :start is not specified
then the first rule in the grammar file is used as the starting
rule. Only the start rule flattens the generated values into a final
string.
raw docstring

grammar->generator-func-sourceclj

(grammar->generator-func-source {:keys [function] :as ctx} grammar)

Takes an grammar (loaded using load-grammar) and returns the text of a namespace with a single Clojure function. The function takes an optional weights map and returns a map of all the rules as generators (indexed by rule-name keyword).

Takes an grammar (loaded using load-grammar) and returns the text
of a namespace with a single Clojure function. The function takes
an optional weights map and returns a map of all the rules as
generators (indexed by rule-name keyword).
raw docstring

RULES-PER-FUNCclj


tag-to-genclj

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close