nit.git
8 years agoMerge: nitcorn: intro an alternative to `answer` allowing more control and revamp...
Jean Privat [Wed, 11 Nov 2015 01:43:47 +0000 (20:43 -0500)]
Merge: nitcorn: intro an alternative to `answer` allowing more control and revamp the README file

The new `prepare_respond_and_close` is an advanced alternative to `answer`. It allows mainly to delay answering to some requests. I may this to implement simple push notifications. It could also be used to do some parallel or IO intensive work, while processing other requests.

The new README should be more up to date and a better support to get to know the library. I'm not sure about including a code example, but I thought it could help. The file could still benefit from some work, but it's an improvement.

Pull-Request: #1828
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: app::ui: intro Label and apply many other fixes
Jean Privat [Wed, 11 Nov 2015 01:43:44 +0000 (20:43 -0500)]
Merge: app::ui: intro Label and apply many other fixes

Most features are self-explanatory, but here it is anyway. `Label` defines a simple non-editable text field. And the newly public `remove` method remove views from other views (such as `Layouts`).

Other fixes clean up the relation with the Java GC and multi-threads behavior.

Pull-Request: #1827
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/libevent: prevent double close
Alexis Laferrière [Tue, 10 Nov 2015 18:57:16 +0000 (13:57 -0500)]
lib/libevent: prevent double close

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

8 years agolib/nitcorn: intro prepare_respond_and_close
Alexis Laferrière [Sat, 7 Nov 2015 18:20:54 +0000 (13:20 -0500)]
lib/nitcorn: intro prepare_respond_and_close

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

fix prepare

8 years agolib/nitcorn: extract `HttpServer::respond`
Alexis Laferrière [Sat, 7 Nov 2015 17:27:32 +0000 (12:27 -0500)]
lib/nitcorn: extract `HttpServer::respond`

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

8 years agolib/nitcorn: revamp README file
Alexis Laferrière [Tue, 10 Nov 2015 02:28:51 +0000 (21:28 -0500)]
lib/nitcorn: revamp README file

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

8 years agolib/app/ui & platforms: intro Label
Alexis Laferrière [Wed, 28 Oct 2015 12:45:56 +0000 (08:45 -0400)]
lib/app/ui & platforms: intro Label

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

8 years agolib/app/ui & platforms: use CompositeControl::remove for Layout
Alexis Laferrière [Sat, 31 Oct 2015 21:07:55 +0000 (17:07 -0400)]
lib/app/ui & platforms: use CompositeControl::remove for Layout

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

8 years agoMerge: frontend: `missing-doc` advice is conditioned to the presence of doc on the...
Jean Privat [Tue, 10 Nov 2015 16:25:41 +0000 (11:25 -0500)]
Merge: frontend: `missing-doc` advice is conditioned to the presence of doc on the module

The `missing-doc` advice is now conditioned to the presence of a doc on the module.

The rationale is that if the module is documented, then the programmer does care and we show places where the documentation is missing, else the programmer does not care then we do not talk about documentation in order to not alienate him.

Pull-Request: #1826
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: add piwik to the nitcatalog
Jean Privat [Tue, 10 Nov 2015 16:25:38 +0000 (11:25 -0500)]
Merge: add piwik to the nitcatalog

Because you do not deserve privacy.

Pull-Request: #1818
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agojava_compiler: handle multi-varargs
Jean Privat [Tue, 10 Nov 2015 16:23:59 +0000 (11:23 -0500)]
java_compiler: handle multi-varargs

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agofrontend: `missing-doc` advice is conditioned to the presence of doc on the module
Jean Privat [Tue, 10 Nov 2015 15:31:10 +0000 (10:31 -0500)]
frontend: `missing-doc` advice is conditioned to the presence of doc on the module

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: add base_vararg_mult.nit
Jean Privat [Tue, 10 Nov 2015 15:01:17 +0000 (10:01 -0500)]
tests: add base_vararg_mult.nit

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelize: combine initialize signatures without losing the vararg information
Jean Privat [Tue, 10 Nov 2015 14:55:35 +0000 (09:55 -0500)]
modelize: combine initialize signatures without losing the vararg information

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodel: accept multiple vararg parameters
Jean Privat [Tue, 10 Nov 2015 14:54:04 +0000 (09:54 -0500)]
model: accept multiple vararg parameters

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotyping: handle multiple vararg
Jean Privat [Tue, 10 Nov 2015 14:47:42 +0000 (09:47 -0500)]
typing: handle multiple vararg

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotyping: extact `check_one_vararg` from `check_signature`
Jean Privat [Tue, 10 Nov 2015 14:46:57 +0000 (09:46 -0500)]
typing: extact `check_one_vararg` from `check_signature`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotyping: move vararg_length on each argument, instead of the whole signature
Jean Privat [Tue, 10 Nov 2015 14:45:58 +0000 (09:45 -0500)]
typing: move vararg_length on each argument, instead of the whole signature

This will permit to have more that one vararg per call.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/android/ui: use more global references
Alexis Laferrière [Fri, 30 Oct 2015 21:01:54 +0000 (17:01 -0400)]
lib/android/ui: use more global references

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

8 years agolib/android/ui: by default, calls to UI features are on the same thread
Alexis Laferrière [Sat, 31 Oct 2015 18:35:45 +0000 (14:35 -0400)]
lib/android/ui: by default, calls to UI features are on the same thread

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

8 years agolib/android/ui: implement new_global_ref where it was missing
Alexis Laferrière [Sat, 31 Oct 2015 14:23:20 +0000 (10:23 -0400)]
lib/android/ui: implement new_global_ref where it was missing

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

8 years agolib/app/ui: fix with #1311
Alexis Laferrière [Sat, 31 Oct 2015 21:08:30 +0000 (17:08 -0400)]
lib/app/ui: fix with #1311

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

8 years agoMerge: autosuperinit: do not crash on broken model
Jean Privat [Mon, 9 Nov 2015 23:29:45 +0000 (18:29 -0500)]
Merge: autosuperinit: do not crash on broken model

Fix the reason that the catalog is currenlty broken (maybe ironicaly related to #1816)

Pull-Request: #1824

8 years agoautosuperinit: do not crash on broken model
Jean Privat [Mon, 9 Nov 2015 19:33:03 +0000 (14:33 -0500)]
autosuperinit: do not crash on broken model

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: app: portable services to do requests over HTTP asynchronously
Jean Privat [Mon, 9 Nov 2015 15:39:20 +0000 (10:39 -0500)]
Merge: app: portable services to do requests over HTTP asynchronously

This PR introduces a series of portable services to execute HTTP request asynchronously from graphical programs. These services should be independent and may be reorganized as needed by client programs.

The HTTP request services are very simple by design, it is not an attempt to define a true API to build the request. It is currently limited to GET calls to a simple URI, for example a simple use may look like:

~~~
print "http://xymus.net/rest/list?query=asdf".http_get.value
~~~

## The services

* `Text::http_get` makes an HTTP request and blocks until the response is received. It returns `HttpRequestResult`, a subclass of `MaybeError`, with a possible error, status code and response body content. This service is implemented independently on each platform, using GDK + Curl on GNU/Linux and Apache HTTP client services in Java on Android.

* `App::run_on_ui_thread` sends an instance of `Task` to be executed on the main UI thread when possible. This method may be moved "up" to `app::ui` as needed.

* `AsyncHttpRequest` combines the two previous features to execute an HTTP request asynchronously, deserialize the result from JSON (if needed) and execute custom behaviors on the main UI thread. Users of this service should subclass `AsyncHttpRequest` and implement as needed `before`, `on_load`, `on_error` and `after`. By default, all user code is executed on the main UI thread and as such users do not have to worry about threading logic.

Pull-Request: #1823
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: json::serialization: intro services to easily serialize to and from Json
Jean Privat [Mon, 9 Nov 2015 15:39:19 +0000 (10:39 -0500)]
Merge: json::serialization: intro services to easily serialize to and from Json

The services `to_json_string` and `from_json_string` should be useful for simple scripts. Both services report errors only on the console. This behavior is enough for simple scripts but more complex programs should still use `Serializer` and `Deserializer` services.

This methods may look a lot like `to_json` and `to_plain_json`. I plan to replace `to_json` with either `to_plain_json` to preserve the same behavior but with support for all serializable classes, or `to_json_string` to get JSON with metadata. Note that even if the output contains metadata, it is readable by external tools with a small overhead.

If you have a better idea for the names, please mention it. For my part, I consider these names temporary until we free the `to_json` names...

Pull-Request: #1822
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: serialization: serialize the Error class and avoid abstract classes with...
Jean Privat [Mon, 9 Nov 2015 15:39:16 +0000 (10:39 -0500)]
Merge: serialization: serialize the Error class and avoid  abstract classes with factories

This PR implements the serialization of the `Error` class manually, it is declared in `core` above the `serialization` module.

Also updates `nitserial` so that it does not attempt to instantiate abstract classes with factories.

@privat I have doubts about the use of `is_abstract` and `is_class`, is it appropriate?

Pull-Request: #1821
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Java FFI: add GC pinning support
Jean Privat [Mon, 9 Nov 2015 15:39:14 +0000 (10:39 -0500)]
Merge: Java FFI: add GC pinning support

Adds a missing features to the Java FFI: pinning references to Nit objects from Java. Both services, `..._incr_ref` and `..._decr_ref`, are "simple" redirections from Java to the nitni service in C through the JNI.

Pull-Request: #1820
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: nitc/android: rely on Android's native stacktrace, drop MIPS support and tempo...
Jean Privat [Mon, 9 Nov 2015 15:38:55 +0000 (10:38 -0500)]
Merge: nitc/android: rely on Android's native stacktrace, drop MIPS support and temporarily disable the GC

This PR tweaks basic Nit features on Android so it is more practical on the short-middle term.

It is better to not handle signals on Android so that it falls back on the Android stacktrace, which is pretty useful for debugging. We might want to handle the signals once we successfully integrate libunwind to the Android apps.

Dropping MIPS support saves some compilation time. The related commit can be reverted when supporting MIPS is useful.

This PR also deactivates the GC on Android as it is currently broken. Unexpected behaviors happen more frequently when using the Java FFI in a threaded app. There are possible solutions to this problem; newer versions of libgc are tweaked for Android, better compilation configs may help, and double checking the Android lib for objects that should be pinned for use from Java...

Pull-Request: #1819
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/json: intro simple services for scripts and the like
Alexis Laferrière [Wed, 28 Oct 2015 12:43:53 +0000 (08:43 -0400)]
lib/json: intro simple services for scripts and the like

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

8 years agolib/serialization: support the Error class
Alexis Laferrière [Sat, 7 Nov 2015 13:02:42 +0000 (08:02 -0500)]
lib/serialization: support the Error class

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

8 years agonitserial: fix support for factory instantiated abstract classes
Alexis Laferrière [Thu, 5 Nov 2015 19:34:35 +0000 (14:34 -0500)]
nitserial: fix support for factory instantiated abstract classes

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

8 years agolib/android: implement http_request, using the Java Apache lib
Alexis Laferrière [Sat, 31 Oct 2015 23:55:28 +0000 (19:55 -0400)]
lib/android: implement http_request, using the Java Apache lib

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

8 years agolib/java: wrap Throwable and Exception
Alexis Laferrière [Sun, 8 Nov 2015 16:38:06 +0000 (11:38 -0500)]
lib/java: wrap Throwable and Exception

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

8 years agolib/linux: implement http_request using GDK events and Curl
Alexis Laferrière [Sat, 31 Oct 2015 23:55:48 +0000 (19:55 -0400)]
lib/linux: implement http_request using GDK events and Curl

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

8 years agolib/gtk: use `Task` with GDK by adding a more previce method to refine
Alexis Laferrière [Sun, 8 Nov 2015 15:03:17 +0000 (10:03 -0500)]
lib/gtk: use `Task` with GDK by adding a more previce method to refine

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

8 years agolib/app: intro the http_request API
Alexis Laferrière [Sat, 31 Oct 2015 23:54:57 +0000 (19:54 -0400)]
lib/app: intro the http_request API

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

8 years agolib/core: fix error in doc of `MaybeError::error`
Alexis Laferrière [Sun, 8 Nov 2015 16:37:08 +0000 (11:37 -0500)]
lib/core: fix error in doc of `MaybeError::error`

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

8 years agolib/json: clean up a few useless signatures
Alexis Laferrière [Wed, 28 Oct 2015 00:33:18 +0000 (20:33 -0400)]
lib/json: clean up a few useless signatures

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

8 years agotests: intro tests for pinning Nit objects from Java
Alexis Laferrière [Sun, 8 Nov 2015 00:31:17 +0000 (19:31 -0500)]
tests: intro tests for pinning Nit objects from Java

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

8 years agonitc: add GC pinning support to the Java FFI
Alexis Laferrière [Sun, 8 Nov 2015 00:26:21 +0000 (19:26 -0500)]
nitc: add GC pinning support to the Java FFI

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

8 years agonitc/android: do not compile for MIPS, but it is easy to bring back
Alexis Laferrière [Thu, 5 Nov 2015 11:58:39 +0000 (06:58 -0500)]
nitc/android: do not compile for MIPS, but it is easy to bring back

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

8 years agonitcatalog: add option in inject piwik tracker
Jean Privat [Sat, 7 Nov 2015 21:53:59 +0000 (16:53 -0500)]
nitcatalog: add option in inject piwik tracker

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcatalog: use the Catalog as a factory of CatalogPage
Jean Privat [Sat, 7 Nov 2015 21:48:24 +0000 (16:48 -0500)]
nitcatalog: use the Catalog as a factory of CatalogPage

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitc/android: do not catch signals on Android, use the default stacktrace
Alexis Laferrière [Mon, 2 Nov 2015 15:14:12 +0000 (10:14 -0500)]
nitc/android: do not catch signals on Android, use the default stacktrace

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

8 years agonitc/android: temporally disable the GC on Android
Alexis Laferrière [Mon, 2 Nov 2015 15:13:33 +0000 (10:13 -0500)]
nitc/android: temporally disable the GC on Android

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

8 years agonitc: fix typo in error message
Alexis Laferrière [Sun, 1 Nov 2015 13:02:35 +0000 (08:02 -0500)]
nitc: fix typo in error message

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

8 years agoMerge: More keepgoing
Jean Privat [Sat, 7 Nov 2015 17:38:47 +0000 (12:38 -0500)]
Merge: More keepgoing

Another small serie about robustness.

Now all files in tests (including alts), except one, do not make `nipick` crash.
This should improve the quality of error messages in vim.

Pull-Request: #1816
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: More contributors
Jean Privat [Sat, 7 Nov 2015 17:38:45 +0000 (12:38 -0500)]
Merge: More contributors

add metadata `package.more_contributors` for lib/core and lib/nitcorn.

Pull-Request: #1815
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: nitcorn: fix bug with binary files
Jean Privat [Sat, 7 Nov 2015 17:38:40 +0000 (12:38 -0500)]
Merge: nitcorn: fix bug with binary files

Downloading binary files from a nitcorn server works as expected once again.

The API should be enough for most users but there is a few features lacking. Namely alternating custom text with files and writing custom data. We could merge the `body` and `files` attributes into a sequence of `Bytables` to send, with support for `Bytes`.

You can test the result on xymus.net, either by downloading the latest WBTW at http://xymus.net/pub/wbtw-v0.4-110-g668b261.tar.gz or by playing a clone of Super Hexagon (mostly made by @ablondin) at http://xymus.net/pub/hex/.

Pull-Request: #1817
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/nitcorn/examples: customize server listening port
Alexis Laferrière [Fri, 18 Sep 2015 20:57:14 +0000 (16:57 -0400)]
lib/nitcorn/examples: customize server listening port

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

8 years agolib/nitcorn/examples: rename the simple_file_server example
Alexis Laferrière [Fri, 18 Sep 2015 20:57:32 +0000 (16:57 -0400)]
lib/nitcorn/examples: rename the simple_file_server example

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

8 years agolib/nitcorn: use `files` and thus fix transferring binary data
Alexis Laferrière [Sat, 19 Sep 2015 13:04:23 +0000 (09:04 -0400)]
lib/nitcorn: use `files` and thus fix transferring binary data

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

8 years agolib/nitcorn: intro `HttpResponse::files` to append files
Alexis Laferrière [Sat, 19 Sep 2015 13:03:56 +0000 (09:03 -0400)]
lib/nitcorn: intro `HttpResponse::files` to append files

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

8 years agolib/libevent: add `read|write_buffer`
Alexis Laferrière [Sat, 7 Nov 2015 13:42:46 +0000 (08:42 -0500)]
lib/libevent: add `read|write_buffer`

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

8 years agolib/libevent: implement missing `write_bytes` in `Connection`
Alexis Laferrière [Sat, 19 Sep 2015 12:37:07 +0000 (08:37 -0400)]
lib/libevent: implement missing `write_bytes` in `Connection`

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

8 years agolib/libevent: update write_file
Alexis Laferrière [Sat, 19 Sep 2015 13:02:45 +0000 (09:02 -0400)]
lib/libevent: update write_file

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

8 years agolib/core: fill `package.more_contributors` metadata as git lost track since renaming...
Jean Privat [Sat, 7 Nov 2015 01:47:40 +0000 (20:47 -0500)]
lib/core: fill `package.more_contributors` metadata as git lost track since renaming (d7f15922adeef40)

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcorn: improve the README a little
Jean Privat [Sat, 7 Nov 2015 04:56:31 +0000 (23:56 -0500)]
nitcorn: improve the README a little

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: improve error tests on --keep-going by adding usage of broken things
Jean Privat [Sat, 7 Nov 2015 04:47:26 +0000 (23:47 -0500)]
tests: improve error tests on --keep-going by adding usage of broken things

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotyping: skip error message when dealing with bottom types
Jean Privat [Sat, 7 Nov 2015 04:45:39 +0000 (23:45 -0500)]
typing: skip error message when dealing with bottom types

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agosrc: use `toolcontext.quit` instead of rogue `exit`
Jean Privat [Sat, 7 Nov 2015 04:13:17 +0000 (23:13 -0500)]
src: use `toolcontext.quit` instead of rogue `exit`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotoolcontext: add `ToolContext::quit` to perform a correct shutdown of the program
Jean Privat [Sat, 7 Nov 2015 04:08:24 +0000 (23:08 -0500)]
toolcontext: add `ToolContext::quit` to perform a correct shutdown of the program

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotyping: AForBlock propagates error to the main AForExpr
Jean Privat [Sat, 7 Nov 2015 03:42:40 +0000 (22:42 -0500)]
typing: AForBlock propagates error to the main AForExpr

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agomodelize_class: do not rely on number of errors since things are more robust
Jean Privat [Sat, 7 Nov 2015 03:26:33 +0000 (22:26 -0500)]
modelize_class: do not rely on number of errors since things are more robust

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcorn: add package.more_contributors metadata
Jean Privat [Sat, 7 Nov 2015 01:39:29 +0000 (20:39 -0500)]
nitcorn: add package.more_contributors metadata

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agonitcatalog: implements `package.more_contributors` per specification
Jean Privat [Sat, 7 Nov 2015 01:28:21 +0000 (20:28 -0500)]
nitcatalog: implements `package.more_contributors` per specification

I tough I did it, but it seems that no.

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: JSON fix
Jean Privat [Sat, 7 Nov 2015 00:58:32 +0000 (19:58 -0500)]
Merge: JSON fix

As @xymus reported in #1796, this PR should fix the aforementioned issue by closing an old TODO in `RopeBuffer::add` that was only supporting ASCII services.

At the same time, some cleanup was done in JSON to use properly our new Unicode-oriented strings that were worked around until now.

Closes #1796

Pull-Request: #1797
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agotests: Updated existing + added new test for escaping in JSON
Lucas Bajolet [Fri, 6 Nov 2015 20:02:27 +0000 (15:02 -0500)]
tests: Updated existing + added new test for escaping in JSON

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agotext/ropes: Fix broken byte iterator in Buffer
Lucas Bajolet [Mon, 2 Nov 2015 16:06:57 +0000 (11:06 -0500)]
text/ropes: Fix broken byte iterator in Buffer

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agotext/ropes: Fixed `RopeBuffer::add` when dealing with something other than an ASCII...
Lucas Bajolet [Fri, 30 Oct 2015 15:23:45 +0000 (11:23 -0400)]
text/ropes: Fixed `RopeBuffer::add` when dealing with something other than an ASCII character

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agojson/static: Replaced uses of write_to_string by to_s since it benefits from copy...
Lucas Bajolet [Fri, 30 Oct 2015 15:24:24 +0000 (11:24 -0400)]
json/static: Replaced uses of write_to_string by to_s since it benefits from copy-on-write mechanisms

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agojson/static: Fixed Unicode escaping in JSON read code
Lucas Bajolet [Fri, 30 Oct 2015 15:22:27 +0000 (11:22 -0400)]
json/static: Fixed Unicode escaping in JSON read code

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agocore/flat: Fix bug in `FlatBuffer::substring`
Lucas Bajolet [Mon, 2 Nov 2015 22:04:22 +0000 (17:04 -0500)]
core/flat: Fix bug in `FlatBuffer::substring`

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agocore/text: Added UTF-16 escape coding/decoding methods
Lucas Bajolet [Mon, 2 Nov 2015 17:16:46 +0000 (12:16 -0500)]
core/text: Added UTF-16 escape coding/decoding methods

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Introduced xoring of String and a sequence of Bytes
Jean Privat [Fri, 6 Nov 2015 01:46:37 +0000 (20:46 -0500)]
Merge: Introduced xoring of String and a sequence of Bytes

Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>

Pull-Request: #1814
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoOptimized SequenceRead instantiation with fixed length in Text.xor
Philippe Pepos Petitclerc [Thu, 5 Nov 2015 20:20:17 +0000 (15:20 -0500)]
Optimized SequenceRead instantiation with fixed length in Text.xor

Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>

8 years agoMoved crypto services from String to Text
Philippe Pepos Petitclerc [Thu, 5 Nov 2015 20:17:23 +0000 (15:17 -0500)]
Moved crypto services from String to Text

Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>

8 years agoIntroduced xoring of String and a sequence of Bytes
Philippe Pepos Petitclerc [Thu, 5 Nov 2015 19:22:28 +0000 (14:22 -0500)]
Introduced xoring of String and a sequence of Bytes

Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>

8 years agoMerge: Intro `Task` and use in for Android's `run_on_ui_thread`
Jean Privat [Thu, 5 Nov 2015 15:13:53 +0000 (10:13 -0500)]
Merge: Intro `Task` and use in for Android's `run_on_ui_thread`

The `Task` interface defines a fragment of Nit code to execute in its `main` method. This interface should be compatible between different platforms and parallelization engines.

`NativeActivity::run_on_ui_thread` is widely used on Android as most logic is executed on background threads but only the UI thread can modify the UI. It is a perfect example of how the `Task` interface can be used.

Future work include using `Task` in `pthreads` and `gtk::gdk`. But there a a few differences in the logic that makes it not as easy: `Thread::main` returns a `nullable object`, but is it worth keeping it? `GdkRunnable::run` returns a boolean to tell GDK if it should be called again.

Pull-Request: #1812
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

8 years agoMerge: lib/gtk: add services from GTK+ 3.10 and rename some core services
Jean Privat [Thu, 5 Nov 2015 15:13:51 +0000 (10:13 -0500)]
Merge: lib/gtk: add services from GTK+ 3.10 and rename some core services

Services from v3.10 includes the `HeaderBar` (the large window top bar with custom buttons) and the `Stack` which shows only 1 widget at a time with transition effects. The renamed services use the same name as in C.

Pull-Request: #1809
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib/nitester: rename local class Task to TesterTask
Alexis Laferrière [Wed, 4 Nov 2015 00:34:51 +0000 (19:34 -0500)]
contrib/nitester: rename local class Task to TesterTask

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

8 years agotests & lib/ui: update gtk users
Alexis Laferrière [Tue, 3 Nov 2015 15:55:22 +0000 (10:55 -0500)]
tests & lib/ui: update gtk users

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

8 years agolib/gtk: intro threading system of GDK
Alexis Laferrière [Wed, 28 Oct 2015 12:45:02 +0000 (08:45 -0400)]
lib/gtk: intro threading system of GDK

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

8 years agolib/gtk: add more services to gtk_core
Alexis Laferrière [Wed, 28 Oct 2015 12:45:21 +0000 (08:45 -0400)]
lib/gtk: add more services to gtk_core

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

8 years agolib/gtk: intro new services from GTK+ 3.10
Alexis Laferrière [Mon, 26 Oct 2015 19:05:21 +0000 (15:05 -0400)]
lib/gtk: intro new services from GTK+ 3.10

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

8 years agolib/gtk: rename gtk life-cycle methods, and other, to their C counter parts
Alexis Laferrière [Wed, 28 Oct 2015 00:32:24 +0000 (20:32 -0400)]
lib/gtk: rename gtk life-cycle methods, and other, to their C counter parts

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

8 years agotests: update tests relying on the content of core
Alexis Laferrière [Tue, 3 Nov 2015 20:09:30 +0000 (15:09 -0500)]
tests: update tests relying on the content of core

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

8 years agolib/android: intro `NativeActivity::run_on_ui_thread`
Alexis Laferrière [Tue, 3 Nov 2015 17:34:34 +0000 (12:34 -0500)]
lib/android: intro `NativeActivity::run_on_ui_thread`

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

8 years agolib/core: intro `Task`
Alexis Laferrière [Tue, 3 Nov 2015 17:42:31 +0000 (12:42 -0500)]
lib/core: intro `Task`

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

8 years agoversion 0.7.9 v0.7.9
Jean Privat [Sat, 31 Oct 2015 14:29:06 +0000 (10:29 -0400)]
version 0.7.9

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Bench strings update
Jean Privat [Thu, 29 Oct 2015 19:04:02 +0000 (15:04 -0400)]
Merge: Bench strings update

A few things happening here:

* Added some line-producing output to `bench_plot.sh`, use both functions to produce lines instead of histograms
* `bench_strings.sh` underwent a few transformations: now you can try with different values of `maxlen` (threshold at which a flat concatenation produces a new Concat node instead of a new FlatString), you can also work on HEAD only with a new option, also, all benches now produce lines instead of histograms

Pull-Request: #1795
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Robust Virtual Type
Jean Privat [Thu, 29 Oct 2015 19:04:00 +0000 (15:04 -0400)]
Merge: Robust Virtual Type

Improve the handling of inconsistent model when virtual types are badly defined.

The changes are mainly done with 2 things:

* still register broken `type` definition in the property, so that properties have at least a definition
* use bottom type (also called the absurd type) to indicate inconsistency in the model (instead of aborting)

Reported-by: @Morriar

Pull-Request: #1791
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: lib/trees: more services and documentation
Jean Privat [Thu, 29 Oct 2015 19:03:55 +0000 (15:03 -0400)]
Merge: lib/trees: more services and documentation

Add `depth` and `Comparable` services to abstract Trees.

Also enhance the abstract_tree module documentation.

Pull-Request: #1787
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agobenches: String benches now produce line graphs, HTML and can be used to test differe...
Lucas Bajolet [Thu, 29 Oct 2015 18:59:22 +0000 (14:59 -0400)]
benches: String benches now produce line graphs, HTML and can be used to test different variations of `maxlen`

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agobench_plot.sh: Fix indentation in prepare_res
Lucas Bajolet [Thu, 29 Oct 2015 19:00:09 +0000 (15:00 -0400)]
bench_plot.sh: Fix indentation in prepare_res

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agobench_plot: Added line-producing plot functions
Lucas Bajolet [Wed, 28 Oct 2015 20:16:54 +0000 (16:16 -0400)]
bench_plot: Added line-producing plot functions

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: nitc can inline redefinitions with -D
Jean Privat [Thu, 29 Oct 2015 12:36:46 +0000 (08:36 -0400)]
Merge: nitc can inline redefinitions with -D

nitc with --global and --semi-global tries to inline things, but methods with an explicit `constant_value` (i.e. defined with `-D`) were not recognized when asked: ``can I inline this?''

The inlining itself does not require specific code.

Close #1793

Pull-Request: #1794
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agotests: add error_redef_vt
Jean Privat [Wed, 28 Oct 2015 16:06:36 +0000 (12:06 -0400)]
tests: add error_redef_vt

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: update sav for VT related tests
Jean Privat [Wed, 28 Oct 2015 16:05:20 +0000 (12:05 -0400)]
tests: update sav for VT related tests

Signed-off-by: Jean Privat <jean@pryen.org>