emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/yaml 7f055d207c 057/124: Merge pull request #17 from co


From: ELPA Syncer
Subject: [elpa] externals/yaml 7f055d207c 057/124: Merge pull request #17 from conao3/plist-keyword
Date: Fri, 29 Nov 2024 16:00:00 -0500 (EST)

branch: externals/yaml
commit 7f055d207c69bd4a418cfc6691ca005ff85188f4
Merge: 2aa5a6faf7 8903b6c7e4
Author: Zachary Romero <zacromero@posteo.net>
Commit: GitHub <noreply@github.com>

    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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]