branch: externals/yaml
commit 7f055d207c69bd4a418cfc6691ca005ff85188f4
Merge: 2aa5a6faf7 8903b6c7e4
Author: Zachary Romero <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #17 from conao3/plist-keyword
Return plist key as a keyword
---
yaml.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/yaml.el b/yaml.el
index 6f2f583b7f..55dcef819e 100644
--- a/yaml.el
+++ b/yaml.el
@@ -413,9 +413,12 @@ This flag is intended for development purposes.")
(progn
(let ((key (pop yaml--cache))
(table (car yaml--object-stack)))
- (when (and (eql 'symbol yaml--parsing-object-key-type)
- (stringp key))
- (setq key (intern key)))
+ (when (stringp key)
+ (cond
+ ((eql 'symbol yaml--parsing-object-key-type)
+ (setq key (intern key)))
+ ((eql 'keyword yaml--parsing-object-key-type)
+ (setq key (intern (format ":%s" key))))))
(puthash key value table))
(pop yaml--state-stack)))
((equal top-state :trail-comments)
@@ -967,10 +970,14 @@ value. It defaults to the symbol :false."
(cond
((or (not object-key-type)
(equal 'string object-key-type))
- (setq yaml--parsing-object-key-type 'string))
+ (if (equal 'plist yaml--parsing-object-type)
+ (setq yaml--parsing-object-key-type 'keyword)
+ (setq yaml--parsing-object-key-type 'string)))
((equal 'symbol object-key-type)
(setq yaml--parsing-object-key-type 'symbol))
- (t (error "Invalid object-key-type. object-key-type must be string, or
symbol")))
+ ((equal 'keyword object-key-type)
+ (setq yaml--parsing-object-key-type 'keyword))
+ (t (error "Invalid object-key-type. object-key-type must be string,
keyword, or symbol")))
(cond
((or (not sequence-type)
(equal sequence-type 'array))