File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 4343(defn append-child
4444 " Append item as child of the current location. Will insert a space if necessary."
4545 [zloc item]
46- (let [r (-> zloc z/down z/rightmost)
46+ (let [r' (z/down zloc)
47+ r (when r' (z/rightmost r'))
4748 item (conv/->tree item)]
4849 (if (or (not r) (not (z/node r)) (zc/whitespace? r))
4950 (-> zloc (z/append-child item))
Original file line number Diff line number Diff line change 218218 (-> root (z/assoc 2 5 ) z/sexpr) => #{1 2 5 }
219219 (-> root (z/assoc 5 8 ) z/sexpr) => (throws IndexOutOfBoundsException)
220220 (->> root (z/map #(z/edit % inc)) z/sexpr) => #{2 3 4 })
221+ (let [root (z/of-string " {}" )]
222+ root => z/seq?
223+ root => z/map?
224+ (z/sexpr root) => {}
225+ (-> root (z/assoc :a 5 ) z/sexpr) => {:a 5 })
221226 (let [root (z/of-string " {:a 1 :b 2}" )]
222227 root => z/seq?
223228 root => z/map?
You can’t perform that action at this time.
0 commit comments