Tcl Library Source Code

Artifact [f66d31cdac]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Artifact f66d31cdac4a9419cc6ac6ce450ee313a1995cb155cde1abafefa76521520d8f:

Attachment "yaml_null_fix.patch" to ticket [4f25e933fc] added by anonymous 2024-03-25 22:41:26. (unpublished)
diff --git a/modules/yaml/yaml.tcl b/modules/yaml/yaml.tcl
index 2ceebe36d..12704484c 100644
--- a/modules/yaml/yaml.tcl
+++ b/modules/yaml/yaml.tcl
@@ -1264,6 +1264,20 @@ namespace eval ::yaml::types {
         }
 
     }
+
+    namespace eval null {
+        variable settings
+
+        set settings {
+            superClass null
+            publicMethods {}
+            tag !!null
+            isContainer no
+        }
+        proc null {} {
+            return [wrap [list null]]
+        }
+    }
 }
 
 proc ::yaml::_makeChildType {type tag} {
@@ -1283,12 +1297,12 @@ proc ::yaml::_makeChildType {type tag} {
 
 huddle addType ::yaml::types::mapping
 huddle addType ::yaml::types::sequence
+huddle addType ::yaml::types::null
 
 huddle addType [::yaml::_makeChildType str !!str]
 huddle addType [::yaml::_makeChildType timestamp !!timestamp]
 huddle addType [::yaml::_makeChildType float !!float]
 huddle addType [::yaml::_makeChildType int !!int]
-huddle addType [::yaml::_makeChildType null !!null]
 huddle addType [::yaml::_makeChildType true !!true]
 huddle addType [::yaml::_makeChildType false !!false]
 huddle addType [::yaml::_makeChildType binary !!binary]