branch: externals/tomelr commit cff1f8aa890d8c08fe26243870d59aa39f602156 Author: Kaushal Modi <kaushal.m...@gmail.com> Commit: Kaushal Modi <kaushal.m...@gmail.com>
fix: Support TOML tables arrays specified as plist vector --- README.org | 7 ++++--- test/tplist.el | 19 +++++++++++-------- tomelr.el | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.org b/README.org index 18d1b37754..ffac82b330 100644 --- a/README.org +++ b/README.org @@ -18,7 +18,7 @@ the Emacs core library [[https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/j It will then be gradually refactored so that it meets the specification defined below. -* Library Completion Status [5/7] +* Library Completion Status [6/7] - [X] Scalar - [X] Boolean - [X] Integer @@ -35,7 +35,7 @@ specification defined below. - [-] Array of Tables - [X] Basic Array of Tables - [ ] Nested Array of Tables -- [ ] Property Lists +- [X] Property Lists * Specification and Conversion Examples [[https://scripter.co/defining-tomelr/][Companion blog post]] @@ -969,7 +969,8 @@ contributors = [ ] } #+end_example -** P-lists +** DONE P-lists +CLOSED: [2022-04-29 Fri 18:42] **** S-expression #+begin_src emacs-lisp :eval no :noweb-ref p-list '(:int 123 diff --git a/test/tplist.el b/test/tplist.el index a8ebf8086f..6798e137cf 100644 --- a/test/tplist.el +++ b/test/tplist.el @@ -40,13 +40,10 @@ :list_of_lists [(1 2) (3 4 5)] :map (:key1 123 :key2 "xyz") - ;; TODO plist specification of TOML tables arrays is - ;; not yet supported. - ;; :list_of_maps [(:key1 123 - ;; :key2 "xyz") - ;; (:key1 567 - ;; :key2 "klm")] - ))) + :list_of_maps [(:key1 123 + :key2 "xyz") + (:key1 567 + :key2 "klm")]))) (ref '("int = 123 str = \"abc\" bool_false = false @@ -57,7 +54,13 @@ bool_list = [ true, false, true, false ] list_of_lists = [ [ 1, 2 ], [ 3, 4, 5 ] ] [map] key1 = 123 - key2 = \"xyz\"")) + key2 = \"xyz\" +[[list_of_maps]] + key1 = 123 + key2 = \"xyz\" +[[list_of_maps]] + key1 = 567 + key2 = \"klm\"")) out) (dolist (el inp) (push (tomelr-encode el) out)) diff --git a/tomelr.el b/tomelr.el index 2ba7549787..1e3a29baab 100644 --- a/tomelr.el +++ b/tomelr.el @@ -377,7 +377,7 @@ Definition of a TOML Table Array (TTA): - OBJECT is TTA if it is of type ((TT1) (TT2) ..) where each element is a TOML Table (TT)." - (when (listp object) + (when (mapp object) (seq-every-p (lambda (elem) (tomelr--toml-table-p elem))