|
|
| version 1.2, 2010/09/02 22:56:09 | version 1.3, 2010/09/24 22:56:35 |
|---|---|
| Line 1 | Line 1 |
| @main[] | @main[] |
| $f[^file::load[text;253_json.txt]] | $f[^file::load[text;253_json.txt; $.charset[windows-1251]]] |
| $s[^taint[as-is][$f.text]] | $s[^taint[as-is][$f.text]] |
| ^try_catch{$o[^json:parse[$s]]} | ^try_catch{$o[^json:parse[$s]]} |
| Line 24 $o[^json:parse[$s][ $.object[$hook] $.di | Line 24 $o[^json:parse[$s][ $.object[$hook] $.di |
| } | } |
| @print[hash] | @print[hash] |
| ^hash.foreach[k;v]{ | ^json:string[$hash; $.indent(1)] |
| $k = ^if($v is 'hash'){{^print[$v] | |
| }}{ | |
| $v.CLASS_NAME ^if($v is 'bool'){ ^if($v){true}{false} }($v is 'class1' || $v is 'class2'){^v.print[]}{$v} | |
| } | |
| } | |
| @hook[key;value] | @hook[key;value] |
| $result[^if(def $value.type){^reflection:create[$value.type;create;$value]}{$value}] | $result[^if(def $value.type){^reflection:create[$value.type;create;$value]}{$value}] |
| Line 38 $result[^if(def $value.type){^reflection | Line 33 $result[^if(def $value.type){^reflection |
| class1 | class1 |
| @create[h] | @create[h] |
| $value[$h.value] | $value[class1 $h.value] |
| @print[] | |
| value "$value" | |
| @CLASS | @CLASS |
| class2 | class2 |
| @create[h] | @create[h] |
| $value[$h.value] | $value[class2 $h.value] |
| @print[] | |
| value "$value" |