Skip to content

Commit 49c715e

Browse files
committed
For prefix-2 elements: pass children to reduce in right order
1 parent 91c2ad8 commit 49c715e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

parseclj-parser.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ functions. Additionally the following options are recognized
235235
new-stack)
236236
(while (and top-value-1 top-value-2 opening-token)
237237
(setq new-stack (nthcdr (apply #'+ (mapcar #'length (list top-value-1 top-value-2 opening-token))) stack))
238-
(setq stack (funcall reduce-branch new-stack (car opening-token) (append (cdr opening-token) top-value-1 top-value-2) options))
238+
(setq stack (funcall reduce-branch new-stack (car opening-token) (append (cdr opening-token) top-value-2 top-value-1) options))
239239

240240
;; recur
241241
(setq top-value-1 (parseclj--take-value stack value-p))

test/parseclj-test.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,15 @@
218218
(:position . 1)
219219
(:children ((:node-type . :with-meta)
220220
(:position . 1)
221-
(:children ((:node-type . :vector)
221+
(:children ((:node-type . :map)
222+
(:position . 2)
223+
(:children))
224+
((:node-type . :vector)
222225
(:position . 5)
223226
(:children ((:node-type . :number)
224227
(:position . 6)
225228
(:form . "123")
226-
(:value . 123))))
227-
((:node-type . :map)
228-
(:position . 2)
229-
(:children)))))))))
229+
(:value . 123)))))))))))
230230

231231
(ert-deftest parseclj--parse-var-test ()
232232
(should (equal

0 commit comments

Comments
 (0)