Skip to content

Commit

Permalink
fix: Support TOML tables arrays specified as plist vector
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Apr 29, 2022
1 parent 4c419bc commit cff1f8a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]]

Expand Down Expand Up @@ -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
Expand Down
19 changes: 11 additions & 8 deletions test/tplist.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tomelr.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit cff1f8a

Please sign in to comment.