Serializable::inspect
to show more useful information
serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsdeserialize_json
and JsonDeserializer
serialize_to_json
and JsonSerializer
core :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Convert MessagePack format to JSON
module msgpack_to_json
import msgpack::read
import json
if args.has("-h") then
print "Usage: nit msgpack::msgpack_to_json [source_file.msgpack]"
print "Convert MessagePack format to JSON. Read from stdin if no source_file is given."
exit 0
end
var reader = if args.length >= 1 then
new FileReader.open(args.first)
else stdin
while reader.last_error == null and not reader.eof do
var deserialized = reader.read_msgpack
if deserialized != null then
print deserialized.serialize_to_json(plain=true, pretty=true)
else
print "null"
end
end
lib/msgpack/msgpack_to_json.nit:15,1--39,3