lib: use a simple iteration in `html_escape` and move to `string`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: introduce module hash_debug

Signed-off-by: Jean Privat <jean@pryen.org>
nitgg: correclty disable attr check with --no-check-attr-isset

Signed-off-by: Jean Privat <jean@pryen.org>
comp: rename --no-check-other to --no-check-null, because it is what it does

Signed-off-by: Jean Privat <jean@pryen.org>
comp: add --no-check-all

Signed-off-by: Jean Privat <jean@pryen.org>
lib/string: use indexed access to chars instead of iterators

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/json_serialization: support Arrays

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
nitserial: intro a support tool to deserialize generic types

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: extend test_deserialization with generics

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: test nitserial itself

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: test a module generated by `nitserial`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: nitg-e doesn't know the full type of generics, expect the error

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Merge: Optimize usage of the chars of a string

* The first commit, on `html_escape`, improves nitdoc execution on RnR by about 10s, or 6%.
* The second commit _theorically_ improves access to the chars of strings. It _worsen_ the execution of nitdoc on RnR by about 9s.

The overall gain on this specific use case is of 1s. Obviously this PR is not to be merged as is!

Pull-Request: #663
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: cleanup --no-check-*

Some people like to live dangerously, they unplug their usb stick without unmounting, they write long comments in a textbox in a browser, they eat pasta with a white t-shirt.
Now, they can also `--no-check-all` to disable all runtime-tests and sweat pure adrenaline.

Some numbers, because people like numbers: `--no-check-all` gives a small 6% boost for compiling nitg.
(for reference, --semi-global is a 20% boost).

Pull-Request: #665
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Merge: Deserialize generics with nitserial

nitserial compiles a Nit module after analyzing a Nit program. This module can then be compiled with the program (possibly using `-m`) to support deserializing any alive generic type. Many generated module can be used to support different libraries with hidden serialization logic, or to support exchanges between a client and a server.

Will be used by the RESTful interface of Benitlux.

Pull-Request: #650
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Merge: lib: introduce module hash_debug

Nit-exclusivity thanks to class refinements, intrude imports and the control of the main function.

Inject behavior analysis to hash-collections (HashMap, HashSet, etc.)
Accesses to hash collections are instrumented, and statistics are automatically displayed at the end of the program.

This module helps to detect, and track bad behavior on hash-collections, especially collisions.

Simple usage:

1. compile your program with `-m hash_debug`
2. execute your program.

Advanced usage:

import `hash_debug` and use the functions `Sys::show_hash_stats` and `Sys::clear_hash_stats` at strategic points.

You can also use some dynamic call-graph tools (like valgrind) and look at callers of `HashCollection::gt_collide` and `HashCollection::st_collide`.

Pull-Request: #664
Reviewed-by: Frédéric Vachon <fredvac@gmail.com>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>