Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tkt-e4cfcc0f96-ak Excluding Merge-Ins
This is equivalent to a diff from 054a65997f to 70ea88b63e
2017-05-30
| ||
16:26 | Merged fixes for ticket e4cfcc0f96: handling of null by hullde json writer. check-in: bf5f60bebe user: andreask tags: trunk | |
16:26 | Ticket e4cfcc0f96: fixed handling of null when generating json. Bumped version to 0.3. Closed-Leaf check-in: 70ea88b63e user: andreask tags: tkt-e4cfcc0f96-ak | |
16:23 | Test cases for json dumping, null handling check-in: 9b5c9460dc user: andreask tags: tkt-e4cfcc0f96-ak | |
16:16 | Fix oops in new code for tar seek errors. check-in: 054a65997f user: andreask tags: trunk | |
15:59 | Merged fixes to reported problems with PCX files check-in: b44b64f121 user: aku tags: trunk | |
Changes to modules/yaml/huddle.man.
|
| | | 1 2 3 4 5 6 7 8 | [vset VERSION 0.3] [comment {-*- tcl -*- doctools manpage}] [manpage_begin huddle n [vset VERSION]] [see_also yaml] [keywords {data exchange}] [keywords {exchange format}] [keywords huddle] [keywords json] |
︙ | ︙ |
Changes to modules/yaml/huddle.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # huddle.tcl (working title) # # huddle.tcl 0.1.5 2011-08-23 14:46:47 KATO Kanryu([email protected]) # # It is published with the terms of tcllib's BSD-style license. # See the file named license.terms. # # This library provide functions to differentinate string/list/dict in multi-ranks. # # Copyright (c) 2008-2011 KATO Kanryu <[email protected]> # Copyright (c) 2015 Miguel Martínez López <[email protected]> package require Tcl 8.5 | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # huddle.tcl (working title) # # huddle.tcl 0.1.5 2011-08-23 14:46:47 KATO Kanryu([email protected]) # # It is published with the terms of tcllib's BSD-style license. # See the file named license.terms. # # This library provide functions to differentinate string/list/dict in multi-ranks. # # Copyright (c) 2008-2011 KATO Kanryu <[email protected]> # Copyright (c) 2015 Miguel Martínez López <[email protected]> package require Tcl 8.5 package provide huddle 0.3 namespace eval ::huddle { namespace export huddle wrap unwrap isHuddle strip_node are_equal_nodes argument_to_node get_src variable types # Some subcommands conflict with Tcl builtin commands. So, we make |
︙ | ︙ | |||
485 486 487 488 489 490 491 | set sp " " if {[string equal $offset ""]} {set sp ""} set type [huddle type $huddle_object] switch -- $type { boolean - | | < > > | | < < < < | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | set sp " " if {[string equal $offset ""]} {set sp ""} set type [huddle type $huddle_object] switch -- $type { boolean - number { return [huddle get_stripped $huddle_object] } null { return null } string { set data [huddle get_stripped $huddle_object] # JSON permits only oneline string set data [string map { \n \\n \t \\t \r \\r \b \\b \f \\f \\ \\\\ \" \\\" / \\/ } $data ] return "\"$data\"" } list { set inner {} set len [huddle llength $huddle_object] for {set i 0} {$i < $len} {incr i} { set subobject [huddle get $huddle_object $i] lappend inner [jsondump $subobject $offset $newline $nextoff] } if {[llength $inner] == 1} { return "\[[lindex $inner 0]\]" } return "\[$nlof[join $inner ,$nlof]$newline$begin\]" } dict { set inner {} foreach {key} [huddle keys $huddle_object] { lappend inner [subst {"$key":$sp[jsondump [huddle get $huddle_object $key] $offset $newline $nextoff]}] } if {[llength $inner] == 1} { return $inner } return "\{$nlof[join $inner ,$nlof]$newline$begin\}" } default { return [$types(callback:$type) jsondump $data $offset $newline $nextoff] } } } # data is plain old tcl values |
︙ | ︙ |
Changes to modules/yaml/huddle.test.
︙ | ︙ | |||
217 218 219 220 221 222 223 224 225 226 227 228 229 230 | } }} set data [json::json2dict $json1] set data [huddle compile {dict dd {dict * dict} ee {dict k number * string}} $data] huddle equal $huddle1 $data } -result {1} # ... Tests of addStrings ... # (Requires introspection of parser state) test huddle-4.1 "test of huddle set" -body { huddle set data_dict dd bb a baa } -result {HUDDLE {D {dd {D {bb {D {a {s baa} c {s d}}} cc {D {e {s f} g {s h}}}}} ee {D {i {s j} k {s l}}}}}} | > > > > > > > > > > > | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | } }} set data [json::json2dict $json1] set data [huddle compile {dict dd {dict * dict} ee {dict k number * string}} $data] huddle equal $huddle1 $data } -result {1} test huddle-3.5 "test of huddle jsondump - null handling" -body { huddle jsondump {HUDDLE null} } -result {null} test huddle-3.6 "test of huddle jsondump - dict and null handling" -body { huddle jsondump {HUDDLE {D {a {s foo} b null}}} } -result {{ "a": "foo", "b": null }} # ... Tests of addStrings ... # (Requires introspection of parser state) test huddle-4.1 "test of huddle set" -body { huddle set data_dict dd bb a baa } -result {HUDDLE {D {dd {D {bb {D {a {s baa} c {s d}}} cc {D {e {s f} g {s h}}}}} ee {D {i {s j} k {s l}}}}}} |
︙ | ︙ |
Changes to modules/yaml/pkgIndex.tcl.
1 2 3 4 | if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded yaml 0.3.10 [list source [file join $dir yaml.tcl]] | | | 1 2 3 4 5 6 | if {![package vsatisfies [package provide Tcl] 8.5]} {return} package ifneeded yaml 0.3.10 [list source [file join $dir yaml.tcl]] package ifneeded huddle 0.3 [list source [file join $dir huddle.tcl]] package ifneeded huddle::json 0.1 [list source [file join $dir json2huddle.tcl]] |