nit.git
8 years agocore/ropes: remove old_style_init, use only named init (not ideal but better)
Jean Privat [Tue, 17 Nov 2015 18:51:01 +0000 (13:51 -0500)]
core/ropes: remove old_style_init, use only named init (not ideal but better)

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

8 years agocore/flat: remove named init `with_pos` and use auto-constructor
Jean Privat [Tue, 17 Nov 2015 18:50:12 +0000 (13:50 -0500)]
core/flat: remove named init `with_pos` and use auto-constructor

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

8 years agohotfix: contrib/tnitter/net.xymus.tnitter.txt: terminate description
Jean Privat [Fri, 13 Nov 2015 18:21:56 +0000 (13:21 -0500)]
hotfix: contrib/tnitter/net.xymus.tnitter.txt: terminate description

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

8 years agoMerge: Tnitter: read the latest tnits on the go with the new Tnitter portable app!
Jean Privat [Fri, 13 Nov 2015 13:29:29 +0000 (08:29 -0500)]
Merge: Tnitter: read the latest tnits on the go with the new Tnitter portable app!

Intro a portable client for Tnitter listing the more recent 16 tnits. It is more of a test and example on using `AsyncHttpRequest` to do both simple request to a REST server and implement push notifications using an open request. By design, this client does not support posting Tnits, this feature would require much more code and it may be simplified by future services in the lib.

To support the client the server has a few new REST interfaces. One to list the tnits and the other for push notifications.

This PR also fixes a few bugs on the Tnitter server: losing the session on posting and empty post being accepted by the server.

-----

Note for the reviewers: You may be better to read commits individually. There are 2 bigs commits, one extracts the database logic from the model module and the other introduces code generated by Jwrapper for the native layer of that Android ui implementation.

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

8 years agocontrib/tnitter: intro .gitignore
Alexis Laferrière [Fri, 13 Nov 2015 12:52:53 +0000 (07:52 -0500)]
contrib/tnitter: intro .gitignore

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

8 years agotnitter: add the clean rule to Makefile
Alexis Laferrière [Thu, 12 Nov 2015 19:37:10 +0000 (14:37 -0500)]
tnitter: add the clean rule to Makefile

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

8 years agocontrib/tnitter: add apk link to metadata
Alexis Laferrière [Thu, 12 Nov 2015 19:36:52 +0000 (14:36 -0500)]
contrib/tnitter: add apk link to metadata

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

8 years agoMerge: Add trails to nitiwiki
Jean Privat [Thu, 12 Nov 2015 01:43:47 +0000 (20:43 -0500)]
Merge: Add trails to nitiwiki

Wikilinks, with the directive `trail`, will register the target page as an element of a trail.
Each `trail` are chained together and will display navigational link `prev` for the previous page of the trail, `next` for the next page of the trail and `up` to go to the pages that has used the `trail` wikilink.

For instance, if the page `doc.md` has the following content:

~~~md
To use nitiwiki, first [[trail: install|install it]],
then [[trail: simple_wiki|create a first wiki]].

You can also do advanced things like:

* [[trail: github|editing pages with github]]
* [[trail: templating| adapting the templates]]
~~~

A trail will be made and will consist of the sequence of pages `install`, `simple_wiki`, `github` and `templating`.
On each one of these pages, there will be links for the previous, the next page and the `doc.md` pae.

If a page includes trail wikilinks and is also the target for trail wikilinks, then the two trails are merged and pages will be visitable in a depth-first order.
This nesting of trails can be used to have sections and sub-sections.

Demo is up: http://info.uqam.ca/~privat/nitlanguage/manual/

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

8 years agoMerge: lib/core: add Text::prefix and Text::suffix
Jean Privat [Thu, 12 Nov 2015 01:43:44 +0000 (20:43 -0500)]
Merge: lib/core: add Text::prefix and Text::suffix

I wanted a way to detect and possibly remove a prefix from a string but there was no straight-forward way.

So I propose one:

~~~
var str = "hello world"
var p = str.prefix("hello")
assert p != null and p.text_after == " world"
assert str.prefix("fail") == null
~~~

Same with `suffix`

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

8 years agoMerge: Handle gracefuly multi-varargs
Jean Privat [Thu, 12 Nov 2015 01:43:38 +0000 (20:43 -0500)]
Merge: Handle gracefuly multi-varargs

This solve a very borderline issue when a signature contains more than one vararg parameter.
They are still refused in the common case but can occurs when multiple initializers are combined into a single constructor.

The implemented semantic is the following:

* vararg parameters remains varag
* if more than one vararg parameter exists in a signature, then the signature does not accepts additional arguments, it means that each vararg is associated to a single argument (a discarded alternative was to only keep the first/last parameter as the main vararg one)
* the associated argument can be either a single value, of a reverse vararg with an ellipsis.

~~~nit
class A
   fun x(i: Int...) is autoinit do end
   fun y(j: Int...) is autoinit do end
end
var a
a = new A(10, 20) # OK: i=[10], j=[20]
a = new A(10, 11, 20) # Refused
a = new A([10, 11]..., 20) # OK: i=[10, 11], j=[20]
a = new A([10, 11]..., [20, 21, 22]...) # OK: i=[10, 11], j=[20, 21, 22]
a = new A([10, 11], [20, 21, 22]) # Refused but a hint is given that `...` may be missing
~~~

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

8 years agonitiwiki: update examples with trails
Jean Privat [Wed, 11 Nov 2015 20:29:03 +0000 (15:29 -0500)]
nitiwiki: update examples with trails

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

8 years agonitiwiki: update README
Jean Privat [Wed, 11 Nov 2015 20:26:41 +0000 (15:26 -0500)]
nitiwiki: update README

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

8 years agonitiwiki: update tests
Jean Privat [Wed, 11 Nov 2015 18:42:31 +0000 (13:42 -0500)]
nitiwiki: update tests

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

8 years agonitiwiki: render trail navigation on the macro-placeholder %`TRAIL%`
Jean Privat [Wed, 11 Nov 2015 16:17:34 +0000 (11:17 -0500)]
nitiwiki: render trail navigation on the macro-placeholder %`TRAIL%`

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

8 years agonitiwiki: add `trail:` command to collect trails
Jean Privat [Wed, 11 Nov 2015 16:16:19 +0000 (11:16 -0500)]
nitiwiki: add `trail:` command to collect trails

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

8 years agonitiwiki: add a simple command extraction on wikilinks.
Jean Privat [Wed, 11 Nov 2015 16:15:01 +0000 (11:15 -0500)]
nitiwiki: add a simple command extraction on wikilinks.

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

8 years agocontrib/tnitter: add fdroid metadata
Alexis Laferrière [Wed, 11 Nov 2015 20:10:27 +0000 (15:10 -0500)]
contrib/tnitter: add fdroid metadata

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

8 years agolib/nitcorn: update xymus.net with latest Tnitter services
Alexis Laferrière [Wed, 11 Nov 2015 14:56:26 +0000 (09:56 -0500)]
lib/nitcorn: update xymus.net with latest Tnitter services

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

8 years agocontrib/tnitter: refactor to set the server interface at compilation
Alexis Laferrière [Tue, 10 Nov 2015 17:37:44 +0000 (12:37 -0500)]
contrib/tnitter: refactor to set the server interface at compilation

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

8 years agocontrib/tnitter: add icon
Alexis Laferrière [Tue, 10 Nov 2015 17:44:49 +0000 (12:44 -0500)]
contrib/tnitter: add icon

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

8 years agocontrib/tnitter: intro simple app
Alexis Laferrière [Tue, 10 Nov 2015 13:41:54 +0000 (08:41 -0500)]
contrib/tnitter: intro simple app

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

8 years agocontrib/tnitter: intro push notification service to the server
Alexis Laferrière [Tue, 10 Nov 2015 13:48:08 +0000 (08:48 -0500)]
contrib/tnitter: intro push notification service to the server

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

8 years agocontrib/tnitter: add REST interface
Alexis Laferrière [Tue, 10 Nov 2015 13:20:58 +0000 (08:20 -0500)]
contrib/tnitter: add REST interface

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

8 years agocontrib/tnitter: do not allow posting empty tnits
Alexis Laferrière [Wed, 11 Nov 2015 15:58:47 +0000 (10:58 -0500)]
contrib/tnitter: do not allow posting empty tnits

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

8 years agocontrib/tnitter: replace `latest_posts` by a 2 args `list_posts`
Alexis Laferrière [Tue, 10 Nov 2015 13:18:20 +0000 (08:18 -0500)]
contrib/tnitter: replace `latest_posts` by a 2 args `list_posts`

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

8 years agocontrib/tnitter: fix logout on post
Alexis Laferrière [Tue, 10 Nov 2015 13:17:40 +0000 (08:17 -0500)]
contrib/tnitter: fix logout on post

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

8 years agocontrib/tnitter: revamp how the DB is handled
Alexis Laferrière [Tue, 10 Nov 2015 03:41:38 +0000 (22:41 -0500)]
contrib/tnitter: revamp how the DB is handled

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

8 years agocontrib/tnitter: extract `DB` from `model` into `database`
Alexis Laferrière [Tue, 10 Nov 2015 03:39:44 +0000 (22:39 -0500)]
contrib/tnitter: extract `DB` from `model` into `database`

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

8 years agolib/android: use the standard "medium" size for labels
Alexis Laferrière [Wed, 11 Nov 2015 19:49:59 +0000 (14:49 -0500)]
lib/android: use the standard "medium" size for labels

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

8 years agolib/app/ui & platforms: intro ListLayout
Alexis Laferrière [Tue, 10 Nov 2015 03:16:47 +0000 (22:16 -0500)]
lib/app/ui & platforms: intro ListLayout

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

8 years agolib/serialization: fix deserialization of Error
Alexis Laferrière [Tue, 10 Nov 2015 22:20:47 +0000 (17:20 -0500)]
lib/serialization: fix deserialization of Error

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

8 years agonitiwiki: add `WikiEntry::a_from` to factorize the creation of links to pages.
Jean Privat [Wed, 11 Nov 2015 16:14:07 +0000 (11:14 -0500)]
nitiwiki: add `WikiEntry::a_from` to factorize the creation of links to pages.

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

8 years agostring_search: add `Text::prefix` and `Text::suffix`
Jean Privat [Wed, 11 Nov 2015 04:20:23 +0000 (23:20 -0500)]
string_search: add `Text::prefix` and `Text::suffix`

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

8 years agostring_search: add `Match::text_before` and `Match::text_after`
Jean Privat [Wed, 11 Nov 2015 04:19:54 +0000 (23:19 -0500)]
string_search: add `Match::text_before` and `Match::text_after`

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

8 years agostring_search: add nitunits to `Match`
Jean Privat [Wed, 11 Nov 2015 04:19:21 +0000 (23:19 -0500)]
string_search: add nitunits to `Match`

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

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>