[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/parseedn a09686fbb9 6/6: Merge pull request #14 from tmpUs
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/parseedn a09686fbb9 6/6: Merge pull request #14 from tmpUser2022/iterative-parseedn-print-seq |
Date: |
Fri, 20 May 2022 04:59:02 -0400 (EDT) |
branch: elpa/parseedn
commit a09686fbb9113b8b1b4f20c9e1dc0d6fea01a64f
Merge: 8dca313b95 7b888171de
Author: Arne Brasseur <arne@arnebrasseur.net>
Commit: GitHub <noreply@github.com>
Merge pull request #14 from tmpUser2022/iterative-parseedn-print-seq
Iterative parseedn-print-seq to avoid overflows
---
parseedn.el | 10 +++++-----
test/parseedn-test.el | 2 ++
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/parseedn.el b/parseedn.el
index 6e93399f91..eb36782792 100644
--- a/parseedn.el
+++ b/parseedn.el
@@ -156,12 +156,12 @@ TAG-READERS is an optional association list. For more
information, see
(defun parseedn-print-seq (coll)
"Insert sequence COLL as EDN into the current buffer."
- (unless (seq-empty-p coll)
- (parseedn-print (elt coll 0)))
- (let ((next (seq-drop coll 1)))
- (when (not (seq-empty-p next))
+ (when (not (seq-empty-p coll))
+ (while (not (seq-empty-p coll))
+ (parseedn-print (elt coll 0))
(insert " ")
- (parseedn-print-seq next))))
+ (setq coll (seq-drop coll 1)))
+ (delete-char -1)))
(defun parseedn-print-hash-or-alist (map &optional ks)
"Insert hash table MAP or elisp alist as an EDN map into the current buffer."
diff --git a/test/parseedn-test.el b/test/parseedn-test.el
index 8d167d54a8..e3c7d88f2f 100644
--- a/test/parseedn-test.el
+++ b/test/parseedn-test.el
@@ -37,6 +37,8 @@
(should (equal (parseedn-print-str nil) "nil"))
(should (equal (parseedn-print-str 100) "100"))
(should (equal (parseedn-print-str 1.2) "1.2"))
+ (should (equal (parseedn-print-str []) "[]"))
+ (should (equal (parseedn-print-str '(edn-set ())) "#{}"))
(should (equal (parseedn-print-str [1 2 3]) "[1 2 3]"))
(should (equal (parseedn-print-str t) "true"))
(should (equal (parseedn-print-str '((a . 1) (b . 2))) "{a 1, b 2}"))
- [nongnu] elpa/parseedn updated (35e9f3173a -> a09686fbb9), ELPA Syncer, 2022/05/20
- [nongnu] elpa/parseedn 7b888171de 2/6: add empty sequences test, ELPA Syncer, 2022/05/20
- [nongnu] elpa/parseedn a09686fbb9 6/6: Merge pull request #14 from tmpUser2022/iterative-parseedn-print-seq,
ELPA Syncer <=
- [nongnu] elpa/parseedn b399b72a8e 1/6: Iterative parseedn-print-seq, ELPA Syncer, 2022/05/20
- [nongnu] elpa/parseedn 2b28df1c3d 4/6: Add empty hash test, ELPA Syncer, 2022/05/20
- [nongnu] elpa/parseedn 8dca313b95 5/6: Merge pull request #15 from tmpUser2022/empty-hash, ELPA Syncer, 2022/05/20
- [nongnu] elpa/parseedn 7f38ea08b4 3/6: Fix empty hash, ELPA Syncer, 2022/05/20