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

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

[elpa] externals/yaml 0bf6a1b686 088/124: YAML anchor should match exact


From: ELPA Syncer
Subject: [elpa] externals/yaml 0bf6a1b686 088/124: YAML anchor should match exactly how it was defined
Date: Fri, 29 Nov 2024 16:00:05 -0500 (EST)

branch: externals/yaml
commit 0bf6a1b6868709c24759a9b478e267090f779841
Author: Zachary Romero <zacromero@posteo.net>
Commit: Zachary Romero <zacromero@posteo.net>

    YAML anchor should match exactly how it was defined
---
 yaml-tests.el | 29 +++++++++++++++++++++++++++++
 yaml.el       |  2 +-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/yaml-tests.el b/yaml-tests.el
index efa21676ab..8b31e851b0 100644
--- a/yaml-tests.el
+++ b/yaml-tests.el
@@ -355,6 +355,35 @@ key-2: |2-
                  (yaml-parse-string "bill-to:
     city:   East Centerville
     state:  KS
+" :object-type 'alist
+  :object-key-type 'string
+  :string-values t)))
+  ;; anchor should expand to be identical to definition
+  (should (equal (yaml-parse-string "bill-to:  &id001
+    street: |
+            123 Tornado Alley
+            Suite 16
+    city:   East Cenrville
+    state:  KS
+
+ship-to:  *id001
+" :object-type 'alist
+  :object-key-type 'string
+  :string-values t)
+                 (yaml-parse-string "bill-to:
+    street: |
+            123 Tornado Alley
+            Suite 16
+    city:   East Cenrville
+    state:  KS
+
+ship-to:
+    street: |
+            123 Tornado Alley
+            Suite 16
+    city:   East Cenrville
+    state:  KS
+
 " :object-type 'alist
   :object-key-type 'string
   :string-values t))))
diff --git a/yaml.el b/yaml.el
index 11965d3c3b..317b85050b 100644
--- a/yaml.el
+++ b/yaml.el
@@ -414,7 +414,7 @@ This flag is intended for development purposes.")
      ((equal top-state :anchor)
       (let* ((anchor (pop yaml--object-stack))
              (name (nth 1 anchor)))
-        (puthash name value* yaml--anchor-mappings)
+        (puthash name value yaml--anchor-mappings)
         (pop yaml--state-stack)
         (yaml--scalar-event nil value)))
      ((equal top-state :sequence)



reply via email to

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