I read the source code a little more. First:
huddle type $config
mapping
There's no provision for a "mapping" in this switch command. Is this a bug?
proc ::yaml::_imp_huddle2yaml {data {offset ""}} {
variable _dumpIndent
set nextoff "$offset[string repeat { } $_dumpIndent]"
switch -- [huddle type $data] {
"string" {
set data [huddle get_stripped $data]
return [_dumpScalar $data $offset]
}
"list" {
set inner {}
set len [huddle llength $data]
for {set i 0} {$i < $len} {incr i} {
set sub [huddle get $data $i]
set sep [expr {[huddle type $sub] eq "string" ? " " : "\n"}]
lappend inner [join [list $offset - $sep [_imp_huddle2yaml $sub $nextoff]] ""]
}
return [join $inner "\n"]
}
"dict" {
set inner {}
foreach {key} [huddle keys $data] {
set sub [huddle get $data $key]
set sep [expr {[huddle type $sub] eq "string" ? " " : "\n"}]
lappend inner [join [list $offset $key: $sep [_imp_huddle2yaml $sub $nextoff]] ""]
}
return [join $inner "\n"]
}
default {
return $data
}
}
}
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)