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

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

[elpa] externals/yaml e711e774b1 074/124: Allow parsing false and/or nul


From: ELPA Syncer
Subject: [elpa] externals/yaml e711e774b1 074/124: Allow parsing false and/or null as nil
Date: Fri, 29 Nov 2024 16:00:03 -0500 (EST)

branch: externals/yaml
commit e711e774b1c070ef85f2338c2e607174ea8cb0c9
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Allow parsing false and/or null as nil
---
 yaml.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/yaml.el b/yaml.el
index 5a21f28cb3..2ed9cf58a6 100644
--- a/yaml.el
+++ b/yaml.el
@@ -1028,11 +1028,17 @@ value.  It defaults to the symbol :false."
   (setq yaml--root nil)
   (setq yaml--anchor-mappings (make-hash-table :test 'equal))
   (setq yaml--resolve-aliases nil)
+  (setq yaml--parsing-null-object
+       (if (plist-member args :null-object)
+           (plist-get args :null-object)
+         :null))
+  (setq yaml--parsing-false-object
+       (if (plist-member args :false-object)
+           (plist-get args :false-object)
+         :false))
   (let ((object-type (plist-get args :object-type))
         (object-key-type (plist-get args :object-key-type))
-        (sequence-type (plist-get args :sequence-type))
-        (null-object (plist-get args :null-object))
-        (false-object (plist-get args :false-object)))
+        (sequence-type (plist-get args :sequence-type)))
     (cond
      ((or (not object-type)
           (equal object-type 'hash-table))
@@ -1060,8 +1066,6 @@ value.  It defaults to the symbol :false."
      ((equal 'list sequence-type)
       (setq yaml--parsing-sequence-type 'list))
      (t (error "Invalid sequence-type.  sequence-type must be list or array")))
-    (setq yaml--parsing-null-object (or null-object :null))
-    (setq yaml--parsing-false-object (or false-object :false))
     (let ((res (yaml--parse string
                  (yaml--top))))
 



reply via email to

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