hara.common.emit-common

*compressed*

dynamic

*emit-fn*

dynamic

*emit-internal*

dynamic

*explode*

dynamic

*indent*

dynamic

*max-len*

dynamic

*multiline*

dynamic

*trace*

dynamic

+emit-lookup+

emit-array

added in 4.0

(emit-array array grammar mopts)(emit-array array grammar mopts emit-fn)

returns an array of emitted strings

emit-assign

added in 3.0

(emit-assign raw args grammar mopts)

emits a setter expression

emit-between

added in 3.0

(emit-between raw args grammar mopts)

emits the raw symbol between two elems

emit-bi

added in 3.0

(emit-bi raw args grammar mopts)

emits infix with two args

emit-class-static-invoke

added in 4.0

(emit-class-static-invoke raw [sym field & args] grammar mopts)

creates

emit-comment

added in 4.0

(emit-comment _ [tag & more :as form] grammar mopts)

emits a comment

emit-common

added in 4.0

(emit-common form grammar mopts)

emits a string based on grammar

emit-common-loop

added in 4.0

(emit-common-loop form grammar mopts)(emit-common-loop form grammar mopts fn-lookup fn-default)

emits the raw string

emit-free

added in 4.0

(emit-free {:keys [sep]} [tag & more :as form] grammar mopts)

emits string with multiline support

emit-free-raw

added in 4.0

(emit-free-raw sep args grammar mopts)

emits free value

emit-indent

added in 4.0

(emit-indent _ [tag & more :as form] grammar mopts)

emits an indented form

emit-index

added in 3.0

(emit-index raw args grammar mopts)

creates an indexed expression

emit-index-entry

added in 3.0

(emit-index-entry v grammar mopts)

classifies the index entry

emit-infix

added in 3.0

(emit-infix raw args grammar mopts)

emits infix ops

emit-infix-default

added in 3.0

(emit-infix-default raw args default grammar mopts)

emits infix with a default value

emit-infix-if

added in 3.0

(emit-infix-if [_ & forms] grammar mopts)

emits an infix if string

emit-infix-if-single

added in 4.0

(emit-infix-if-single [_ check then else] grammar mopts)

checks for infix in single

(emit-infix-if ’(:? true x y) helper/+default+ {}) => “true ? x : y”

emit-infix-pre

added in 3.0

(emit-infix-pre raw args grammar mopts)

emits infix with a default value

emit-internal

added in 4.0

(emit-internal [_ value] grammar mopts)

emits string within the form

emit-internal-str

added in 4.0

(emit-internal-str [_ value] grammar mopts)

emits internal string

emit-invoke

added in 3.0

(emit-invoke _ [sym & args :as form] grammar mopts)

general invoke call, incorporating keywords

emit-invoke-args

added in 3.0

(emit-invoke-args args grammar mopts)

produces the string for invoke call

emit-invoke-kw-pair

added in 3.0

(emit-invoke-kw-pair [k v] grammar mopts)

emits a kw argument pair

emit-invoke-layout

added in 4.0

(emit-invoke-layout str-array grammar mopts)

layout for invoke blocks

(emit-invoke-layout “ab\nc” “de\nf” helper/+default+ {}) => “(ab\nc,de\nf)”

emit-invoke-raw

added in 3.0

(emit-invoke-raw raw args grammar mopts)

invoke call for reserved ops

emit-invoke-static

added in 3.0

(emit-invoke-static [sym & args] grammar mopts)

generates a static call, alternat

emit-invoke-typecast

added in 3.0

(emit-invoke-typecast form grammar mopts)

generates typecast expression

emit-macro

added in 4.0

(emit-macro _ [tag & more :as form] grammar mopts)

emits form

emit-new

added in 3.0

(emit-new raw [sym & more :as args] grammar mopts)

invokes a constructor

emit-op

added in 3.0

(emit-op key [sym & args :as form] {:keys [reserved], :as grammar} mopts & [expansion])

helper for the emit op

emit-post

added in 3.0

(emit-post raw args grammar mopts)

emits string after the arg

emit-postfix

added in 4.0

(emit-postfix raw args grammar mopts)

emits operator before the arg

emit-pre

added in 3.0

(emit-pre raw args grammar mopts)

emits string before the arg

emit-prefix

added in 4.0

(emit-prefix raw args grammar mopts)

emits operator before the arg

emit-reserved-value

added in 4.0

(emit-reserved-value form {:keys [reserved], :as grammar} mopts)

emits a reserved value

emit-return

added in 3.0

(emit-return raw args grammar mopts)

creates a return type statement

emit-return-base

added in 4.0

(emit-return-base raw args grammar mopts)

return base type

emit-return-do

added in 4.0

(emit-return-do arg grammar mopts)

creates a return statement on do block

emit-squash

added in 4.0

(emit-squash _ [tag & more] grammar mopts)

emits a squashed representation

emit-symbol

added in 4.0

(emit-symbol sym grammar mopts)

emits symbol allowing for custom functions

emit-symbol-classify

added in 3.0

(emit-symbol-classify sym {:keys [module entry book], :as mopts})

classify symbol given options

(emit-symbol-classify ’t/hello {:module {:alias ’{t table}}}) => ’:alias table

(emit-symbol-classify ’t.n/hello {:module {:alias ’{t table}}}) => ’:unknown t.n

emit-symbol-standard

added in 3.0

(emit-symbol-standard sym grammar {:keys [lang layout module], :as mopts})

emits a standard symbol

(emit-symbol-standard ’print! helper/+default+ {:layout :full}) => “printf”

(emit-symbol-standard ’print! {:token {:symbol {:replace {}} :string {:quote :single}}} {:layout :full}) => “print!”

emit-token

added in 3.0

(emit-token key token grammar mopts)

customisable emit function for tokens

emit-unit

added in 4.0

(emit-unit {:keys [raw default transform], :as props} [_ value] grammar mopts)

emits a unit

emit-with-decorate

added in 4.0

(emit-with-decorate _ [_ opts form] grammar mopts)

customisable emit function for global vars

emit-with-global

added in 4.0

(emit-with-global _ [_ token] grammar mopts)

customisable emit function for global vars

emit-with-rand

added in 4.0

(emit-with-rand _ [_ & [type]] grammar mopts)

injects uuid for testing

emit-with-uuid

added in 4.0

(emit-with-uuid _ [_ & [seed0 seed1 :as seeds]] grammar mopts)

injects uuid for testing

emit-wrappable?

added in 4.0

(emit-wrappable? form grammar)

checks if form if wrappable

emit-wrapping

added in 4.0

(emit-wrapping form grammar mopts)

emits a potentially wrapped form

form-key

added in 3.0

(form-key form {:keys [banned reserved], :as grammar})

returns the key associated with the form

invoke-kw-parse

added in 3.0

(invoke-kw-parse args)

seperates standard and keyword arguments

newline-indent

added in 3.0

(newline-indent)

returns a newline with indent

with-compressed

macro

added in 3.0

(with-compressed & body)

formats without newlines and indents

with-indent

macro

added in 3.0

(with-indent [& increment] & body)

adds indentation levels

with-trace

macro

added in 4.0

(with-trace & body)

form to control trace option

with:explode

macro

added in 4.0

(with:explode & body)

form to control explode option

wrapped-str

added in 3.0

(wrapped-str inner path grammar)

wrapped string using :start and :end keys of grammar