Merge: json: move up general services, support Byte and more
authorJean Privat <jean@pryen.org>
Thu, 7 Sep 2017 14:48:56 +0000 (10:48 -0400)
committerJean Privat <jean@pryen.org>
Thu, 7 Sep 2017 14:48:56 +0000 (10:48 -0400)
This PR is a general clean up of the `json` package to prepare the support of two new serialization engines, add small new features and fix some issues in code. It should not change its behavior for existing clients.

* Move up some general deserialization services from `json` to `serialization` in order to make them available to other engines. This includes the class name manipulation services and safety services controlling which types are deserialized, including `class_inheritance_metamodel`.

* Support writing and reading `Byte` as either a plain JSON string or a special object with metadata.

* Support reading `Char` and `Byte` from plain JSON input using simple heuristics.

* Test the deserialization of plain generated JSON and fix a typo in the tests.

* Fix other minor issues in code.

Pull-Request: #2538

1  2 
lib/json/serialization_read.nit

  # Services to read JSON: `from_json_string` and `JsonDeserializer`
  module serialization_read
  
- import ::serialization::caching
- private import ::serialization::engine_tools
+ import serialization::caching
+ private import serialization::engine_tools
+ import serialization::safe
  private import static
 -private import string_parser
  import poset
  
  # Deserializer from a Json string.