Jean Privat [Tue, 17 May 2016 01:22:59 +0000 (21:22 -0400)]
Merge: SQLite: update and simplify wrapper
This PR updates the SQLite wrapper so it is easier to understand and maintain, and as a bonus it is now compatible with the interpreter.
The C code and native layer now uses only `NativeString`, and the calls `to_cstring` and `NativeString::to_s` are moved to the Nit code and nity layer. The error code on opening a database is kept on the C side and retrieved only as needed. This removes a lot of callbacks which simplifies the code and makes the module compatible with the interpreter.
Pull-Request: #2092
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 17 May 2016 01:22:55 +0000 (21:22 -0400)]
Merge: Admin interface for Benitlux and fixes
This PR adds a RESTful admin interface to the Benitlux server. This interface is used to trigger sending out the daily menu notifications from an external program / cron.
As a fix to the diff showing everything as new on the menu, the server now standardizes the received dates to the format expected by SQLite. There is also a small fix to the library used by the code generated by nitrestful to correctly check for errors.
Pull-Request: #2090
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 17 May 2016 01:22:52 +0000 (21:22 -0400)]
Merge: Add quality metrics to the nit catalog
Three new metrics:
* number of errors (boo)
* number of warnings (and advices)
* percentage of documentation (with ponderation)
The 3 firsts commits was to make errors&warnings accessible without printing them.
Pull-Request: #2081
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 17 May 2016 01:22:48 +0000 (21:22 -0400)]
Merge: JSON: merge 2 services into `serialize_to_json` and isolate from `static`
The first goal of this PR is to create a simple but customizable service to write Nit objects to JSON (replacing `to_json_string` and `to_plain_json`). It also clarifies how the serialization of a single object can be customized by refining `accept_json_serializer` which allows the same customization of the existing recursive `to_json` but on any `Serializable` objects.
The second goal is to isolate `json::serialization` from `json::static`. This allows to hide the complexity of `static` to clients of `serialization` and will help to deprecate the `static` writing services. After this PR, `serialization` uses really only one service from `static`, `String::to_json` which escapes strings. While `paser_json` uses the new @R4PaSs implementation. The types of `static` didn't add any useful services in the context of the `JsonDeserializer` (they only have writing services) and added both complexity and dependencies to the module.
All of this would make it easy (if there is still interest) to unify all JSON writing APIs and replace the current `Jsonable::to_json` with a single `Serializable::to_json` using the implementation of the new method `serialize_to_json`. And we can update the existing `redef fun to_json` to `redef fun accept_json_serializer` writing to a stream instead of a string.
Pull-Request: #2068
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Tue, 17 May 2016 00:32:22 +0000 (20:32 -0400)]
lib/android: update import and doc of `sensors`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 13 May 2016 16:31:53 +0000 (12:31 -0400)]
contrib/asteronits: fix touch_ui (Mobile on screen controls)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 16 May 2016 17:22:00 +0000 (13:22 -0400)]
lib/sqlite3: update error management to be more simple use only the light FFI
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 8 Apr 2016 12:58:58 +0000 (08:58 -0400)]
lib/sqlite3: use only NativeString in the native layer
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 13 May 2016 16:26:24 +0000 (12:26 -0400)]
lib/android: update README with info on the 2 core implementations
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 13 May 2016 16:07:50 +0000 (12:07 -0400)]
contrib & examples: update Android adaptations to the new entrypoint
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 1 May 2016 19:11:35 +0000 (15:11 -0400)]
lib/android: revamp entrypoint
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 6 Apr 2016 02:17:41 +0000 (22:17 -0400)]
contrib/benitlux: intro `BenitluxRESTAction::check_token`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 5 Apr 2016 20:29:28 +0000 (16:29 -0400)]
contrib/benitlux: intro the admin server interface with daily notification
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 11 May 2016 13:34:19 +0000 (09:34 -0400)]
contrib/benitlux: standardize dates on the server-side
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 11 May 2016 13:33:48 +0000 (09:33 -0400)]
lib/sqlite3: intro `Text::to_sql_date_string`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Mon, 16 May 2016 20:01:36 +0000 (16:01 -0400)]
tests: Updated `test_substring` for edge case in `ASCIIFlatString::substring`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 16 May 2016 19:59:03 +0000 (15:59 -0400)]
lib/core: Fix substring in `ASCIIFlatString`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 16 May 2016 18:41:42 +0000 (14:41 -0400)]
src/nitlight: Updated client to avoid crashes on unparsed modules
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
itsWill [Sun, 27 Dec 2015 08:27:03 +0000 (09:27 +0100)]
started working on a wrapper for postgres
Signed-off-by: itsWill <guilhermerpmansur@gmail.com>
Alexis Laferrière [Tue, 5 Apr 2016 03:19:06 +0000 (23:19 -0400)]
lib/nitcorn: fix checking errors after deserialization in nitrestful lib
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
jcbrinfo [Sat, 14 May 2016 15:58:56 +0000 (11:58 -0400)]
doc: Fix a mispelled word in the parser’s README
Jean Privat [Sat, 14 May 2016 15:56:13 +0000 (11:56 -0400)]
Merge: Some nitunit love
Two small changes
* nitunit works on directories. e.g. `nitunit lib/ contrib/`
* static errors are shown with precise location.
~~~
test_doc3.nit:17,9--15: Syntax Error: unexpected identifier 'garbage'. To suppress this message, enclose the block with a fence tagged `nitish` or `raw` (see `man nitdoc`). (invalid-block)
# *garbage*
^
~~~
runtime errors are a more complex beast to track. Two solutions:
* pragma to inject line informations in the generated test program. This need to find a syntax for line pragmas and teach the parser to use them
* post-error management that parse error messages and substitute the locations from the the generated program with the original locations in the real source. Doable but more code is needed.
Pull-Request: #2075
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 14 May 2016 15:56:12 +0000 (11:56 -0400)]
Merge: CSV Benchmarks
This PR introduces a new benchmark script for CSV parsers.
Are tested here:
* Nit CSV Ad-hoc parser
* Go standard parser
* Java Apache Commons CSV parser
* Python - Pandas
* Python - Standard
* Ruby - Standard
Will upload some measurements later but *spoiler alert* Python - Pandas is the fastest on large files, Ruby is the slowest by far, Java is the second slower with a big margin from the rest.
Go/Nit/Python-Standard are almost equivalent.
Pull-Request: #2072
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 15:56:10 +0000 (11:56 -0400)]
Merge: Add a Dockerfile to build a full image of a Nit install
The image is based on Debian stable (jessie) with a lot of packages.
I'm not sure what is the point of such images for the end-users.
My objective was just to test a Nit installation on a fresh, full & reproductible base.
Image will be available in the docker hub: https://hub.docker.com/r/nitlang/nit/
The only tests that fails are:
* ballz_android dino_android shoot_android ui_test test_platform_android: no android
* emscripten_nodejs: no emstripten
* test_neo_args1 test_neo4j test_neo4j_batch: no neo4j
* mpi_simple: bizarre error messages
* simple_file_server: the user is root so 80 can be opened :/
* test_glsl_validation: not installed
nitunit need also to be run
Pull-Request: #2070
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Jean Privat [Sat, 14 May 2016 15:23:21 +0000 (11:23 -0400)]
modelize: mark property broken is they are bad introduction
Signed-off-by: Jean Privat <jean@pryen.org>
Philippe Pepos Petitclerc [Fri, 13 May 2016 19:04:07 +0000 (15:04 -0400)]
lib/crypto: Introduce hamming distance on Bytes
New method to calculate the bitwise hamming distance on Bytes.
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Jean Privat [Sat, 14 May 2016 02:51:18 +0000 (22:51 -0400)]
tests: update *light tests with more popup messages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 02:50:48 +0000 (22:50 -0400)]
tests: update catalog res with quality box
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 02:19:43 +0000 (22:19 -0400)]
Merge: Rubix cube - Catalog and documentation update
A .ini file has been added for support in catalog, along with some module documentation for `lib/rubix.nit`
Close #2076.
Pull-Request: #2077
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 14 May 2016 02:19:34 +0000 (22:19 -0400)]
Merge: Promote location in MEntity
For some unknown historical reasons, the location was only provided to some specific model entities. By extending it to all entities, this simplify clients that need to process, visit or filter entities.
Location is not nullable for all entities. This is simpler but need some place-holder object for fictive location. ie some location objects that mean "no location".
Pull-Request: #2045
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sat, 14 May 2016 01:48:00 +0000 (21:48 -0400)]
catalog: add documentation score
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 01:28:47 +0000 (21:28 -0400)]
catalog: count errors and warnings for each package
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 01:27:47 +0000 (21:27 -0400)]
toolcontext: also register messages to the source-files
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 01:26:59 +0000 (21:26 -0400)]
toolcontext: attach messages to location, even if quieted
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 14 May 2016 01:26:08 +0000 (21:26 -0400)]
toolcontext: add Message::level
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 13 May 2016 20:48:46 +0000 (16:48 -0400)]
nitc/neo.nit: adapt code to promoted locations
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 18:55:03 +0000 (14:55 -0400)]
nitc/model: add location to MType
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 15:58:50 +0000 (11:58 -0400)]
nitc: model_visitor shows the location
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 15:45:51 +0000 (11:45 -0400)]
model: add location to MClass and MProperty
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 13 May 2016 17:53:50 +0000 (13:53 -0400)]
model: filepath is now just an alias on the location
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 15:43:36 +0000 (11:43 -0400)]
model: add location to packages and groups
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 15:42:20 +0000 (11:42 -0400)]
model: promote location to any `MEntity`
Signed-off-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Fri, 13 May 2016 19:28:06 +0000 (15:28 -0400)]
lib: Added catalog ini for `rubix` project
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 13 May 2016 19:27:33 +0000 (15:27 -0400)]
lib: Added documentation on rubix module
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 12 May 2016 19:22:33 +0000 (15:22 -0400)]
benchmarks/csv: Added README
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 12 May 2016 19:22:20 +0000 (15:22 -0400)]
benchmarks: Added CSV benchmark to bench suite
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Fri, 13 May 2016 18:09:27 +0000 (14:09 -0400)]
tests: update expected errors to the new JSON parser engine
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 13 May 2016 18:04:56 +0000 (14:04 -0400)]
contrib: update clients of `to_json_string`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 12 May 2016 13:59:16 +0000 (09:59 -0400)]
lib/json: serialization services use the new string_parser
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 12 May 2016 13:17:49 +0000 (09:17 -0400)]
lib/json: add a reference to `serialize_to_json` in `to_json`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 12 May 2016 12:53:36 +0000 (08:53 -0400)]
lib/json: add error checking in the json deserialization example
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 12 May 2016 13:29:55 +0000 (09:29 -0400)]
lib/json: document how to refine `accept_json_serializer` and make it protected
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Apr 2016 14:35:34 +0000 (10:35 -0400)]
lib/json: merge different `to_jsons` into a single `serialize_to_json`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sun, 1 May 2016 15:39:28 +0000 (11:39 -0400)]
nitc/location: add named constructor `opaque_file`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 13 May 2016 17:18:42 +0000 (13:18 -0400)]
Merge: lib/base64: Support line breaks in base64 strings.
This allows to read directly ascii-armored blocks.
close #2069
Pull-Request: #2071
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 13 May 2016 17:18:37 +0000 (13:18 -0400)]
Merge: Introduce crapto modules for cryptographic attacks.
Introduce a frequency analysis service for the english language.
Pull-Request: #2063
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 13 May 2016 17:14:58 +0000 (13:14 -0400)]
tests: unitunit gives more precise error locations
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 13 May 2016 14:21:58 +0000 (10:21 -0400)]
nitunit: give precise error location on invalid docunits.
Signed-off-by: Jean Privat <jean@pryen.org>
Philippe Pepos Petitclerc [Tue, 10 May 2016 19:29:31 +0000 (15:29 -0400)]
Introduce lib/crapto and a frequency analysis service.
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Jean Privat [Fri, 13 May 2016 01:14:06 +0000 (21:14 -0400)]
nitc/loader: filter_nit_source accept directories
so `nitunit lib/` will test all the package of the `lib/` directory
Signed-off-by: Jean Privat <jean@pryen.org>
Philippe Pepos Petitclerc [Thu, 12 May 2016 19:06:31 +0000 (15:06 -0400)]
lib/base64: Support line breaks in base64 strings.
This allows to read directly ascii-armored blocks.
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Jean Privat [Thu, 12 May 2016 18:19:00 +0000 (14:19 -0400)]
Add a Dockerfile to build a full image of a Nit install
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Tue, 26 Apr 2016 12:01:24 +0000 (08:01 -0400)]
lib/json: rename serialize_to_json to accept_json_serializer
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 25 Apr 2016 14:36:09 +0000 (10:36 -0400)]
lib/json: remove public dependency from serialization to static
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 11 May 2016 23:11:47 +0000 (19:11 -0400)]
Merge: Calculator: add scientific features and nicer adaptations for Android and iOS
This is a long overdue update to the calculator which is the reference example for the _app.nit_ framework.
This PR adds scientific operations and constants to the calculator, directly in the logic, and only as a refinement of the UI. There is also new aesthetic adaptations for Android and iOS.
The calculator now uses Unicode operators like ÷ and ×, and internally a string instead of a `FlatBuffer` for simplicity. This change revealed errors in FFI wrappers where `to_s_with_copy` should have been used.
Pull-Request: #2066
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 11 May 2016 23:11:44 +0000 (19:11 -0400)]
Merge: Added a service to xor `Bytes`
Needed a new constructor for `Bytes` to facilitate things.
Pull-Request: #2061
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 11 May 2016 23:11:41 +0000 (19:11 -0400)]
Merge: Update gitignore to exclude DS_Store
The .DS_Store file is automatically generated by the Mac OS filesystem to keep metainformation about that directory. This files is unnecessary to the project so should be excluded in the .gitignore
@privat
Pull-Request: #2060
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Philippe Pepos Petitclerc [Wed, 11 May 2016 20:37:57 +0000 (16:37 -0400)]
lib/crypto: Remove xor cipher on Text.
It could be counter intuitive because of unicode. Explicitly casting to `Bytes`
first will be clearer.
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Philippe Pepos Petitclerc [Tue, 10 May 2016 18:44:52 +0000 (14:44 -0400)]
lib/crypto: Add a xor'ing function to Bytes.
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Alexis Laferrière [Wed, 11 May 2016 18:13:34 +0000 (14:13 -0400)]
calculator: implement unary minus
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 11 May 2016 17:09:43 +0000 (13:09 -0400)]
calculator: add screenshots to the README
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 5 May 2016 19:09:17 +0000 (15:09 -0400)]
calculator: mobile apps use the scientific variant
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 11 May 2016 17:31:35 +0000 (13:31 -0400)]
calculator: intro iOS adaptation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 1 May 2016 21:43:48 +0000 (17:43 -0400)]
calculator: intro Android adaptation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 11 May 2016 16:00:34 +0000 (12:00 -0400)]
calculator: add scientific variation to the portable app
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 1 May 2016 19:11:14 +0000 (15:11 -0400)]
calculator: extend the calculator logic with scientific operators
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 5 May 2016 21:50:38 +0000 (17:50 -0400)]
calculator: replace the FlatBuffer with a simple String
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 1 May 2016 19:10:44 +0000 (15:10 -0400)]
calculator: use Unicode strings instead of single chars for operators
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 11 May 2016 17:57:53 +0000 (13:57 -0400)]
lib/cocoa: fix NSString::to_s to use to_s_with_copy
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 5 May 2016 20:03:12 +0000 (16:03 -0400)]
lib/gtk: copy all strings into Nit memory
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
itsWill [Tue, 10 May 2016 20:06:12 +0000 (22:06 +0200)]
updated .gitignore to ignore .DS_Store
Signed-off-by: itsWill <guilhermerpmansur@gmail.com>
Jean Privat [Tue, 10 May 2016 14:32:32 +0000 (10:32 -0400)]
Merge: JSON Parser Optimization
This PR improves the speed of JSON parsing with the `string_parser` module. The new version of `parse_json_string` is heavily inspired by Python's implementation, available [here](https://github.com/python/cpython/blob/master/Modules/_json.c)
Time is usually either as performing as before or better, Valgrind also gives the new version an advantage, sometimes significant.
On `large_escaped` (~120M, lots of escaped characters), we have:
* Before: 13 748 436 458 Ir
* After: 11 687 104 643 Ir
i.e. an improvement of ~18%
Time is:
* Before: 0m4.428s
* After: 0m3.932s
i.e. an improvement of ~13%
Note that on this particular test, although the number of allocations is limited as much as we can, Boehm still cannibalizes the runtime, seeing that the real time is ~2.6s.
Perf gives a total time of ~38% in GC_mark and ~7% in GC_cache_miss.
Some more optimizations can be thought, but this shows how important a good GC is necessary for the future, this program can be a good metric of how GC usage can be improved.
For further reference, Python3 on the same test gives the following output on time and Valgrind:
* Time (user): 0m1.760s
* Time (real): 0m2.177s
* Valgrind: 8 845 966 867 Ir
Pull-Request: #2058
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 10 May 2016 14:31:50 +0000 (10:31 -0400)]
Merge: bugfix: `is optional` attributes was evaluated too much
`is optional` attribute must not be evaluated on the allocation, but only if `null` is given in the `new`.
Since the use of `is optional` did not spread, no one seems to have been bitten yet.
Pull-Request: #2053
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 9 May 2016 19:11:27 +0000 (15:11 -0400)]
lib/core: Perfize reset in `FlatBuffer`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 20:33:07 +0000 (16:33 -0400)]
lib/core: Replaced FFI version of set_char_at by pure Nit
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 20:32:45 +0000 (16:32 -0400)]
lib/core: Added new `append_substring` service to avoid creating ephemeral instances
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 20:32:04 +0000 (16:32 -0400)]
lib/json: Faster `parse_json_string` implementation
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 6 May 2016 20:31:25 +0000 (16:31 -0400)]
Merge: Flatbuffer fix
Fix a bug at initialization of a flat buffer from a string.
Reported by @BlackMinou
Pull-Request: #2056
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 May 2016 20:31:22 +0000 (16:31 -0400)]
Merge: lib/fixed_ints: fix crash on `"-".is_int`
Pull-Request: #2055
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 17:38:41 +0000 (13:38 -0400)]
tests: Added test for `FlatBuffer::from`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 15:43:09 +0000 (11:43 -0400)]
lib/json: Implemented `pretty_json_visit` on JsonParseError
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 15:42:39 +0000 (11:42 -0400)]
lib/core: Added surrogate detection methods to `Char`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 5 May 2016 15:05:42 +0000 (11:05 -0400)]
lib/core: Fix `new FlatBuffer.from`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Thu, 5 May 2016 17:26:16 +0000 (13:26 -0400)]
tests: update result of test_text_stat for change to is_int
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 1 May 2016 21:33:53 +0000 (17:33 -0400)]
lib/fixed_ints: fix crash on `"-".is_int`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 5 May 2016 01:30:28 +0000 (21:30 -0400)]
Merge: Fix RopeBytes
A bug had found its way into RopeBytes when merging UTF-8, this PR should fix the issues with it.
Close #2014
Pull-Request: #2052
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 5 May 2016 01:30:17 +0000 (21:30 -0400)]
Merge: Examples class name
@Morriar was interested in the `try_get_mclass_by_id` for its documentation services but wanted to pass a string (and not a AST node) and work on all module (not just one).
I suggested to use parse_something to transform the string into a qualified class name then filter the classes of the model on it. As an experimentation, I wrote a simple example program that does this.
@Morriar then suggested to put the sample program in the repository to document how can the various tools of the model can be used to do things.
This PR inaugurate the new directory `src/examples` that is intended to contains small snippets and programs that use the `nitc` package.
Pull-Request: #2050
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 5 May 2016 01:30:15 +0000 (21:30 -0400)]
Merge: Clean some errors in benches
add html output for json and fix two issues in http://gresil.org/jenkins/job/nit_bench/120/testReport/
Pull-Request: #2043
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 4 May 2016 14:27:17 +0000 (10:27 -0400)]
tests: add base_is_optional to check the evaluation order of attribute values
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 4 May 2016 14:25:50 +0000 (10:25 -0400)]
nitc/engines: do not initialize optional attributes on the allocation
Signed-off-by: Jean Privat <jean@pryen.org>