Skip to content

Commit

Permalink
Add dynamic vars to override row and col names
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jan 19, 2020
1 parent 96ae2f7 commit 98a912c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/EDAMAME_VERSION
@@ -1 +1 @@
0.0.10-alpha.5
0.0.10-alpha.6
13 changes: 9 additions & 4 deletions src/edamame/impl/parser.cljc
Expand Up @@ -19,6 +19,11 @@

#?(:clj (set! *warn-on-reflection* true))

(def ^:dynamic *row-key* :row)
(def ^:dynamic *col-key* :col)
(def ^:dynamic *end-row-key* :end-row)
(def ^:dynamic *end-col-key* :end-col)

;;;; tools.reader

(defn edn-read [ctx #?(:cljs ^not-native reader :default reader)]
Expand Down Expand Up @@ -472,10 +477,10 @@
:cljs (satisfies? IWithMeta obj))
(let [end-loc (location reader)]
(vary-meta obj #(assoc %
:row (:row loc)
:col (:col loc)
:end-row (:row end-loc)
:end-col (:col end-loc))))
*row-key* (:row loc)
*col-key* (:col loc)
*end-row-key* (:row end-loc)
*end-col-key* (:col end-loc))))
obj)))
::eof))

Expand Down

0 comments on commit 98a912c

Please sign in to comment.