For a list of breaking changes, check here
Edamame: configurable EDN and Clojure parser with location metadata and more
- Restrict numeric part of new Clojure 1.12 array notation
- Support new
byte/1
array notation
- Support new
^[String]
metadata notation which desugars into^{:param-tags [String]}
- Add
:map
and:set
options to coerce map/set literals into customizable data structures, for example, an ordered collections to preserve key order.
(require '[edamame.core :as e])
(require '[flatland.ordered.map :as m])
(e/parse-string "{:a 1}" {:map m/ordered-map}) ;;=> #ordered/map ([:a 1])
(require '[clojure.data.json :as j])
(j/write-str (e/parse-string "{:a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8 :i 9 :j 10 :k 11 :l 12}" {:map m/ordered-map}))
;;=> "{\"a\":1,\"b\":2,\"c\":3,\"d\":4,\"e\":5,\"f\":6,\"g\":7,\"h\":8,\"i\":9,\"j\":10,\"k\":11,\"l\":12}"
- Fix #103: infinite loop with reader conditional expression
- Add stricter checks for whitespace in parsing namespaced maps
- Allow whitespace between
:
and{
when reading namespaced map
- Add
:uneval
option to preserve#_
expressions combined with next value - Fix transient issue
- Fall back to
:auto-resolve
when:auto-resolve-ns
can't find alias
- Add
:auto-resolve-ns
option. See docs. - Add
parse-ns-form
helper function which returns map of data from ns form.
- Add
parse-next+string
for reading next value + the read string (analog toread+string
in Clojure)
- Fix #93: read-cond assumes
LineNumberingIndexReader
- Optimization: reset source logging buffer when reading source
- Fix #76: nested fn literals not allowed
- Improve error message when reading invalid symbol
- Small performance improvement
- Fix bug introduced in 0.0.16 by change in issue #86
- Support reading with
PushbackReader
which is not an indexing reader #86
- Fix reading of
##Inf
withclojure.lang.LineNumberingPushbackReader
#85
1@2
should be parsed as1 (clojure.core/deref 2)
foo@bar
should be parsed asfoo (clojure.core/deref bar)
#83
- Revert #70, instead return
cljs.tagged-literals/JSValue
object which should be evaluated manually.
- Expose expected delimiter as public data in exception #81
- Return array-based map when c <= 16 #78
:end-location
option #75- Auto-resolved map fails for current ns #74
location?
predicate #72- Handle whitespace after reader conditional splice #71
- Fix parsing of trailing uneval in reader conditional #65
- Return JS array when using #js [1 2 3] #70
- Expose
iobj?
fn - Upgrade to tools.reader
1.3.4
- Support capturing source string #67
- Expose parse-next #5
- Allow value for
:readers
to be a map or a function - Throw EOF while reading with single quote #61
- Fix issue with stack depth and comment parsing
- preserve metadata by allowing postprocess function #52
- Support parsing Clojure code in tagged literals #50
- Preserve metadata on anonymous function body
- allow function in
:read-cond
#47 - fully qualify unquote
- fix line numbers when using shebang #48
- Revert #70, instead return
cljs.tagged-literals/JSValue
object which should be evaluated manually.
- Function literals now expand into a call to
fn*
instead offn
- Options to tools.reader, like
:readers
for passing reader tag functions, now have to be passed as:tools.reader/opts
in the options. - The
:dispatch
option has been deprecated. It still works in 0.0.8 but is now undocumented and planned to be removed in a future version.