hara.common.emit-data
emit-coll
added in 3.0
(emit-coll key form grammar mopts)(emit-coll key form grammar mopts emit-fn)emits a collection
emit-coll-layout
added in 4.0
(emit-coll-layout key indent str-array grammar mopts)constructs the collection
emit-data-standard
added in 4.0
(emit-data-standard key form grammar mopts)emits either a custom string or default coll
emit-maybe-multibody
added in 4.0
(emit-maybe-multibody [prefix-yes prefix-no] body & [indent])emit-quote
added in 4.0
(emit-quote key props [sym & args :as form] grammar mopts)emit quote structures
(emit-quote nil nil ''(1 2 3) +grammar+ {}) => “(1,2,3)”
emit-singleline-array?
added in 4.0
(emit-singleline-array? body-arr)checks that array is all single lines
(emit-singleline-array? “1” “2” “3”) => true
(emit-singleline-array? “1” “\n2” “3”) => false
emit-table
added in 4.0
(emit-table _ _ [_ & args] grammar mopts)emit quote structures
(emit-table nil nil ’(tab :a 1 :b 2) +grammar+ {}) => “{"a":1,"b":2}”
emit-table-group
added in 4.0
(emit-table-group args)gets table group
(emit-table-group :a 1 :b 2 :c :d)
test-data-loop
added in 4.0
(test-data-loop form grammar mopts)emit for data structures
(test-data-loop ’(+ 1 2) +grammar+ {}) => “(+ 1 2)”
(test-data-loop ’{:a (+ 1 2)} +grammar+ {}) => “{:a (+ 1 2)}”
(test-data-loop ’#{(+ 1 2)} +grammar+ {}) => throws
:quote (test-data-loop ''((+ A B) C) +grammar+ {}) => “((+ A B),C)”
(test-data-loop ''(+ A B) C +grammar+ {}) => “(+ A B),C”
:table (test-data-loop ’(tab :a (+ 1 2) :b 2) +grammar+ {}) => “{"a":(+ 1 2),"b":2}”
(test-data-loop ’(tab 1 (+ 1 2) 3 4 5) +grammar+ {}) => “{1,(+ 1 2),3,4,5}”