[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tomelr 0eb4fa04ac 43/84: fix: Don't let array of TOML t
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tomelr 0eb4fa04ac 43/84: fix: Don't let array of TOML tables be recognized as TOML tables |
Date: |
Tue, 3 May 2022 09:58:11 -0400 (EDT) |
branch: externals/tomelr
commit 0eb4fa04ac3e6741f743ba451b1ec7a019989b5e
Author: Kaushal Modi <kaushal.modi@gmail.com>
Commit: Kaushal Modi <kaushal.modi@gmail.com>
fix: Don't let array of TOML tables be recognized as TOML tables
---
test/tinternal.el | 3 ++-
tomelr.el | 19 ++++++++++---------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/test/tinternal.el b/test/tinternal.el
index 9564b5c9af..b80950b434 100644
--- a/test/tinternal.el
+++ b/test/tinternal.el
@@ -38,7 +38,8 @@
(ert-deftest test-internal-invalid-toml-tables ()
(let ((inp '(
(a 1)
- ;; (((a . 1))) ;This is an array of TOML table
+ ((:a 1)) ;This is an array of TOML table
+ (((a . 1))) ;This is an array of TOML table
)))
(dolist (el inp)
(should (equal nil (tomelr--toml-table-p el))))))
diff --git a/tomelr.el b/tomelr.el
index edbf7e6aa4..c6ef0ba4f8 100644
--- a/tomelr.el
+++ b/tomelr.el
@@ -270,11 +270,11 @@ Definition of a TOML Table (TT):
OBJECT is a nested TT. In that case, pass (WHATEVER) to
`tomelr--toml-table-p'."
(let (tablep)
- ;; (message "[tomelr--toml-table-p DBG] object = %S, type = %S, mapp = %S,
length = %d"
- ;; object (type-of object) (mapp object) (safe-length object))
+ ;; (message "[tomelr--toml-table-p DBG] object = %S, type = %S, len = %d"
+ ;; object (type-of object) (safe-length object))
(when (listp object)
- ;; (message "[tomelr--toml-table-p DBG] first elem = %S, type = %S"
- ;; (car object) (type-of (car object)))
+ ;; (message "[tomelr--toml-table-p DBG] first elem = %S, type = %S, len
= %d"
+ ;; (car object) (type-of (car object)) (safe-length (car
object)))
(setq tablep
(cond
((json-plist-p object)
@@ -283,13 +283,14 @@ Definition of a TOML Table (TT):
;; Ensure that every element in the `object' is a (KEY
;; . VAL) kind of cons.
(lambda (elem)
- ;; (message " [tomelr--toml-table-p DBG] elem = %S, type =
%S"
- ;; elem (type-of elem))
+ ;; (message " [tomelr--toml-table-p DBG] elem = %S, type =
%S, len = %d"
+ ;; elem (type-of elem) (safe-length elem))
;; (when (listp elem)
- ;; (message " [tomelr--toml-table-p DBG] sub-elem 0 = %S,
type = %S"
- ;; (nth 0 elem) (type-of (nth 0 elem))))
+ ;; (message " [tomelr--toml-table-p DBG] sub-elem 0 = %S,
type = %S, len = %d"
+ ;; (car elem) (type-of (car elem)) (safe-length
(car elem))))
(and (consp elem)
- (= 1 (safe-length elem))))
+ (= 1 (safe-length elem))
+ (not (consp (car elem)))))
object)
t)
((and (listp (car object))
- [elpa] externals/tomelr c2d1328c44 80/84: fix: Boolean coercing when value is a symbol true or false, (continued)
- [elpa] externals/tomelr c2d1328c44 80/84: fix: Boolean coercing when value is a symbol true or false, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr ebe5959174 75/84: feat: Auto-coerce string to boolean, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr a676192b43 81/84: fix: Integer coercing of a number strings with underscores, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 8da825067b 15/84: chore(readme): Update, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 65653d53ee 30/84: chore(doc): M-x checkdoc fixes, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr bcaea16ec0 39/84: chore(doc): Clean up old code block, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 45542fb234 67/84: chore: Bump version, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 7c004af90d 66/84: style: Remove unnecessary tomelr-encode-* functions, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 568de5efb2 83/84: chore: Bump version, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 0d4674f782 42/84: test: Test `tomelr--toml-table-p`, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 0eb4fa04ac 43/84: fix: Don't let array of TOML tables be recognized as TOML tables,
ELPA Syncer <=
- [elpa] externals/tomelr a33dbd1286 50/84: fix: Detect nested TTA correctly when not present in first TT key, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr dc9b2a63f8 60/84: doc: Remove an invalid example, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 044b5e1a04 61/84: fix: TT with key with array value are detected correctly, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 171e5a7682 62/84: fix: List format array of plists now detected as TOML Table Array, ELPA Syncer, 2022/05/03
- [elpa] externals/tomelr 57bed2cca8 73/84: test: Add a test for string scalar with blank lines, ELPA Syncer, 2022/05/03