nit.git
8 years agotyping: change specification about default arguments. everything is done here
Jean Privat [Thu, 6 Aug 2015 18:32:14 +0000 (14:32 -0400)]
typing: change specification about default arguments. everything is done here

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

8 years agolib/sepx: provide location to each parsed node
Jean Privat [Thu, 6 Aug 2015 18:59:20 +0000 (14:59 -0400)]
lib/sepx: provide location to each parsed node

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

8 years agonitdoc: explicitly set titles of articles to null in constructor call
Jean Privat [Thu, 6 Aug 2015 15:14:28 +0000 (11:14 -0400)]
nitdoc: explicitly set titles of articles to null in constructor call

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

8 years agoserialization: initialize `keep_going` to null
Jean Privat [Thu, 6 Aug 2015 15:13:45 +0000 (11:13 -0400)]
serialization: initialize `keep_going` to null

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

8 years agolib/dom: remove useless visibility
Jean Privat [Thu, 6 Aug 2015 15:04:07 +0000 (11:04 -0400)]
lib/dom: remove useless visibility

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

8 years agolib/dom: remove `null` call warning
Jean Privat [Thu, 6 Aug 2015 15:03:50 +0000 (11:03 -0400)]
lib/dom: remove `null` call warning

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

8 years agolib/dom: add missing documentation
Jean Privat [Thu, 6 Aug 2015 15:02:58 +0000 (11:02 -0400)]
lib/dom: add missing documentation

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

8 years agotests: update sav for text_xml_read
Jean Privat [Thu, 6 Aug 2015 14:35:27 +0000 (10:35 -0400)]
tests: update sav for text_xml_read

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

8 years agolib/dom: give location to all parsed XML nodes
Jean Privat [Thu, 6 Aug 2015 14:33:43 +0000 (10:33 -0400)]
lib/dom: give location to all parsed XML nodes

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

8 years agolib/dom: remove urequired use of named arguments
Jean Privat [Thu, 6 Aug 2015 14:31:23 +0000 (10:31 -0400)]
lib/dom: remove urequired use of named arguments

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

8 years agolib/dom: initialize `XMLEntity::parent` to null
Jean Privat [Thu, 6 Aug 2015 14:31:57 +0000 (10:31 -0400)]
lib/dom: initialize `XMLEntity::parent` to null

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

8 years agolib/dom: remove useless variable
Jean Privat [Thu, 6 Aug 2015 14:29:03 +0000 (10:29 -0400)]
lib/dom: remove useless variable

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

8 years agoMerge: lib/maths: add `nan` and `inf` as special Float
Jean Privat [Wed, 5 Aug 2015 15:53:12 +0000 (11:53 -0400)]
Merge: lib/maths: add `nan` and `inf` as special Float

with bits of IEEE 754

Pull-Request: #1612
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: Can use lib/github/github_curl without a oauth token
Jean Privat [Wed, 5 Aug 2015 15:53:09 +0000 (11:53 -0400)]
Merge: Can use lib/github/github_curl without a oauth token

Nothing fancy but I wanted to merge PR tonight and I found the oauth token requirement a bit harsh

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

8 years agoMerge: contrib: add a simple planner that use lib/ai
Jean Privat [Wed, 5 Aug 2015 15:53:06 +0000 (11:53 -0400)]
Merge: contrib: add a simple planner that use lib/ai

This is a basic implementation for a TP given by a professor who wants to remain anonymous.
I'm quite sure the algorithm and the implementation can be improved, but it does the job in a quite acceptable time performance.

Pull-Request: #1596
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agocontrib: add a simple planner that use lib/ai
Jean Privat [Wed, 5 Aug 2015 15:51:24 +0000 (11:51 -0400)]
contrib: add a simple planner that use lib/ai

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

8 years agolib/maths: add `nan` and `inf` as special Float
Jean Privat [Wed, 5 Aug 2015 08:08:41 +0000 (04:08 -0400)]
lib/maths: add `nan` and `inf` as special Float

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

8 years agoMerge: jwrapper reproduces Java class hierarchy in Nit and serialize model
Jean Privat [Wed, 5 Aug 2015 07:04:25 +0000 (03:04 -0400)]
Merge: jwrapper reproduces Java class hierarchy in Nit and serialize model

Continuing the work of #1578, #1589 and #1599, this PR adds the last big feature missing from jwrapper: duplicating the class hierarchy from Java to the generated wrapper classes. This allows user code to benefit from polymorphism when invoking Java methods wrappers.

This is done by collecting the implements and extends declaration from the javap output, rebuilding the class hierarchy and adding the super declarations needed to reproduce the hierarchy in Nit. To support a compatible hierarchy across modules, the model can now be serialized to a file and read by the following passes. Note that jwrapper wraps classes and interfaces in the same way so the implements and the extends hierarchy are merge into one on the Nit side.

What's to do next:
* Integrate generated modules in the `::java` and `::android` libraries!
* Add tools to extract concerns from a Jar archive to subdivide the wrappers in many modules. This could be done by targeting types, but more experimentation is needed.
* Clean up the duplicated features from the grep search and the serialized models. This is also an evolution as the grep features should be phased out in favor of a better `::java` lib and the serialized models.
* Automate declaring importations by using knowledge from the serialized models.
* Generate casts between the Java wrapper classes?
* Update the documentation with the latest changes.

What I'm probably not gonna do unless someone needs it:
* Full vararg types support, this would probably require using the JNI from C. In the time being, it can be done manually with a fixed number of parameters, as needed.

Pull-Request: #1608
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/performance_analysis: relax unit test expected results
Alexis Laferrière [Tue, 4 Aug 2015 20:45:19 +0000 (16:45 -0400)]
lib/performance_analysis: relax unit test expected results

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

8 years agocontrib/jwrapper examples: update android_api to use a serialized model
Alexis Laferrière [Mon, 3 Aug 2015 16:35:18 +0000 (12:35 -0400)]
contrib/jwrapper examples: update android_api to use a serialized model

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

8 years agocontrib/jwrapper examples: update java_api to benefit from polymorphism
Alexis Laferrière [Sat, 1 Aug 2015 13:26:36 +0000 (09:26 -0400)]
contrib/jwrapper examples: update java_api to benefit from polymorphism

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

8 years agocontrib/jwrapper: saving the model must be asked by an option
Alexis Laferrière [Tue, 4 Aug 2015 18:40:41 +0000 (14:40 -0400)]
contrib/jwrapper: saving the model must be asked by an option

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

8 years agocontrib/jwrapper: only reference to `java.lang.Object` if known by the model
Alexis Laferrière [Tue, 4 Aug 2015 18:24:33 +0000 (14:24 -0400)]
contrib/jwrapper: only reference to `java.lang.Object` if known by the model

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

8 years agocontrib/jwrapper: add an option to not generate methods
Alexis Laferrière [Mon, 3 Aug 2015 18:20:38 +0000 (14:20 -0400)]
contrib/jwrapper: add an option to not generate methods

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

8 years agocontrib/jwrapper: use serialized models to build the complete class hierarchy
Alexis Laferrière [Mon, 3 Aug 2015 16:36:16 +0000 (12:36 -0400)]
contrib/jwrapper: use serialized models to build the complete class hierarchy

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

8 years agocontrib/jwrapper: intro reading models from file
Alexis Laferrière [Mon, 3 Aug 2015 16:29:25 +0000 (12:29 -0400)]
contrib/jwrapper: intro reading models from file

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

8 years agocontrib/jwrapper: write the model to a file next to the Nit module
Alexis Laferrière [Mon, 3 Aug 2015 16:33:01 +0000 (12:33 -0400)]
contrib/jwrapper: write the model to a file next to the Nit module

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

8 years agocontrib/jwrapper: enable serialization of model
Alexis Laferrière [Mon, 3 Aug 2015 14:06:52 +0000 (10:06 -0400)]
contrib/jwrapper: enable serialization of model

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

8 years agocontrib/jwrapper: generate classes in linearization order
Alexis Laferrière [Mon, 3 Aug 2015 13:42:20 +0000 (09:42 -0400)]
contrib/jwrapper: generate classes in linearization order

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

8 years agocontrib/jwrapper: prevent name conflicts with inherited properties
Alexis Laferrière [Sat, 1 Aug 2015 13:24:18 +0000 (09:24 -0400)]
contrib/jwrapper: prevent name conflicts with inherited properties

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

8 years agocontrib/jwrapper: generate only locally introduced methods in each class
Alexis Laferrière [Sat, 1 Aug 2015 13:25:48 +0000 (09:25 -0400)]
contrib/jwrapper: generate only locally introduced methods in each class

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

8 years agocontrib/jwrapper: silence all useless-superclass warnings
Alexis Laferrière [Sat, 1 Aug 2015 13:09:18 +0000 (09:09 -0400)]
contrib/jwrapper: silence all useless-superclass warnings

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

8 years agocontrib/jwrapper: compute the methods introduced by each classes
Alexis Laferrière [Sat, 1 Aug 2015 13:32:32 +0000 (09:32 -0400)]
contrib/jwrapper: compute the methods introduced by each classes

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

8 years agocontrib/jwrapper: copy class hierarchy over to Nit
Alexis Laferrière [Mon, 3 Aug 2015 13:46:53 +0000 (09:46 -0400)]
contrib/jwrapper: copy class hierarchy over to Nit

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

8 years agocontrib/jwrapper: build class hierarchy into a POSet
Alexis Laferrière [Wed, 29 Jul 2015 19:04:48 +0000 (15:04 -0400)]
contrib/jwrapper: build class hierarchy into a POSet

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

8 years agocontrib/jwrapper: collect super-classes data
Alexis Laferrière [Wed, 29 Jul 2015 18:08:59 +0000 (14:08 -0400)]
contrib/jwrapper: collect super-classes data

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

8 years agocontrib/jwrapper: revamp class header generation
Alexis Laferrière [Wed, 29 Jul 2015 18:18:52 +0000 (14:18 -0400)]
contrib/jwrapper: revamp class header generation

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

8 years agocontrib/jwrapper: create the tmp directory as needed
Alexis Laferrière [Mon, 3 Aug 2015 16:24:52 +0000 (12:24 -0400)]
contrib/jwrapper: create the tmp directory as needed

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

8 years agocontrib/jwrapper: implement == and hash in JavaClass and JavaMethod
Alexis Laferrière [Sat, 1 Aug 2015 13:05:04 +0000 (09:05 -0400)]
contrib/jwrapper: implement == and hash in JavaClass and JavaMethod

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

8 years agocontrib/jwrapper: close module file stream after writing
Alexis Laferrière [Mon, 3 Aug 2015 16:30:24 +0000 (12:30 -0400)]
contrib/jwrapper: close module file stream after writing

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

8 years agocontrib/jwrapper grammar: reorder of the grammar file (no other changes)
Alexis Laferrière [Sun, 2 Aug 2015 16:20:01 +0000 (12:20 -0400)]
contrib/jwrapper grammar: reorder of the grammar file (no other changes)

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

8 years agocontrib/jwrapper grammar: unify all lists of things that look like a type
Alexis Laferrière [Wed, 29 Jul 2015 18:08:12 +0000 (14:08 -0400)]
contrib/jwrapper grammar: unify all lists of things that look like a type

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

8 years agoMerge: curl: implement CURLOPT_TIMEOUT and CURLOPT_TIMEOUT_MS
Jean Privat [Wed, 5 Aug 2015 01:08:27 +0000 (21:08 -0400)]
Merge: curl: implement CURLOPT_TIMEOUT and CURLOPT_TIMEOUT_MS

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1610
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>

8 years agoMerge: lib/performance_analysis: relax nitunit expected results
Jean Privat [Wed, 5 Aug 2015 01:08:19 +0000 (21:08 -0400)]
Merge: lib/performance_analysis: relax nitunit expected results

This should be enough to fix #1562.

Pull-Request: #1609
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib/github_merge: can merge localy without github oauth (need readonly)
Jean Privat [Wed, 5 Aug 2015 01:06:29 +0000 (21:06 -0400)]
contrib/github_merge: can merge localy without github oauth (need readonly)

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

8 years agolib/github: can connect without OAuth token
Jean Privat [Wed, 5 Aug 2015 01:04:07 +0000 (21:04 -0400)]
lib/github: can connect without OAuth token

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

8 years agolib/curl: Collection::to_curlslist do not crash on empty lists
Jean Privat [Wed, 5 Aug 2015 01:00:18 +0000 (21:00 -0400)]
lib/curl: Collection::to_curlslist do not crash on empty lists

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

8 years agocurl: implement CURLOPT_TIMEOUT and CURLOPT_TIMEOUT_MS
Alexandre Terrasa [Tue, 4 Aug 2015 21:57:19 +0000 (17:57 -0400)]
curl: implement CURLOPT_TIMEOUT and CURLOPT_TIMEOUT_MS

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agolib/performance_analysis: relax unit test expected results
Alexis Laferrière [Tue, 4 Aug 2015 20:45:19 +0000 (16:45 -0400)]
lib/performance_analysis: relax unit test expected results

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

8 years agoMerge: Tinks! fix frame lock between clients and servers
Jean Privat [Tue, 4 Aug 2015 20:10:28 +0000 (16:10 -0400)]
Merge: Tinks! fix frame lock between clients and servers

This PR greatly improve multiplayer performance by removing the synchronous frames between the clients and server.

There is still a lot of stuff to do on Tinks! see the notes in #1601.

Pull-Request: #1607
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Simplify integer parsing
Jean Privat [Tue, 4 Aug 2015 20:10:26 +0000 (16:10 -0400)]
Merge: Simplify integer parsing

As a follow-up to #1602, a more aggressive factorization of the parser, along with a few methods that produce Numeric values of the right type.

Pull-Request: #1606
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Fix nitcorn `Content-Length` when working with UTF-8 files
Jean Privat [Tue, 4 Aug 2015 20:10:23 +0000 (16:10 -0400)]
Merge: Fix nitcorn `Content-Length` when working with UTF-8 files

Changes:
* use `bytelen` instead of `length` when setting `Content-Length` header
* add media types for web fonts

Pull-Request: #1605
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agotests: Update sav for parser updates
Lucas Bajolet [Tue, 4 Aug 2015 18:35:49 +0000 (14:35 -0400)]
tests: Update sav for parser updates

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

8 years agosrc: Parser regeneration
Lucas Bajolet [Tue, 4 Aug 2015 14:36:03 +0000 (10:36 -0400)]
src: Parser regeneration

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

8 years agosrc: Modified compilers for the support of the new Integers
Lucas Bajolet [Mon, 3 Aug 2015 22:21:35 +0000 (18:21 -0400)]
src: Modified compilers for the support of the new Integers

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

8 years agoparser: Factorized variants of Integer under one production
Lucas Bajolet [Fri, 31 Jul 2015 18:13:14 +0000 (14:13 -0400)]
parser: Factorized variants of Integer under one production

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

8 years agolib/standard/text: Added parsing method for all integers
Lucas Bajolet [Mon, 3 Aug 2015 22:10:37 +0000 (18:10 -0400)]
lib/standard/text: Added parsing method for all integers

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

8 years agocontrib/tinks: increment the comm version number
Alexis Laferrière [Tue, 4 Aug 2015 15:54:42 +0000 (11:54 -0400)]
contrib/tinks: increment the comm version number

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

8 years agocontrib/tinks: greatly reduce the vibration strength under android
Alexis Laferrière [Fri, 31 Jul 2015 20:44:11 +0000 (16:44 -0400)]
contrib/tinks: greatly reduce the vibration strength under android

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

8 years agocontrib/tinks: client do not send empty orders array to server
Alexis Laferrière [Fri, 31 Jul 2015 13:33:27 +0000 (09:33 -0400)]
contrib/tinks: client do not send empty orders array to server

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

8 years agocontrib/tinks: server does not wait after its clients at each frame
Alexis Laferrière [Fri, 31 Jul 2015 13:28:21 +0000 (09:28 -0400)]
contrib/tinks: server does not wait after its clients at each frame

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

8 years agolib/gamnit: use async cache for the client/server logic
Alexis Laferrière [Fri, 31 Jul 2015 13:28:15 +0000 (09:28 -0400)]
lib/gamnit: use async cache for the client/server logic

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

8 years agolib/serialization: intro AsyncCache
Alexis Laferrière [Fri, 31 Jul 2015 12:57:36 +0000 (08:57 -0400)]
lib/serialization: intro AsyncCache

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

8 years agolib/socket: use a custom C call to detect error on sockets
Alexis Laferrière [Fri, 31 Jul 2015 13:20:55 +0000 (09:20 -0400)]
lib/socket: use a custom C call to detect error on sockets

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

8 years agonitcorn: add media types for web fonts.
Alexandre Terrasa [Mon, 3 Aug 2015 21:18:19 +0000 (17:18 -0400)]
nitcorn: add media types for web fonts.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agonitcorn: use `bytelen` instead of `length` when setting `Content-Length` header
Alexandre Terrasa [Mon, 3 Aug 2015 21:17:32 +0000 (17:17 -0400)]
nitcorn: use `bytelen` instead of `length` when setting `Content-Length` header

So UTF-8 files are rendered correctly.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: Tinks! a multiplayer crossplatform action game with destructible procedurally...
Jean Privat [Mon, 3 Aug 2015 18:35:23 +0000 (14:35 -0400)]
Merge: Tinks! a multiplayer crossplatform action game with destructible procedurally generated worlds

Players control a tank, open fire from its turret and navigate between the terrain features. Explosions from turret fire and tank destruction have different forces and destroy the terrain. Each tank needs 4 hits to be destroyed. Destroyed tanks drops health powerups which can repair other tanks.

The game is meant for the multiplayer but one can play alone to practice. Upon launch, a client searches for server by broadcasting a UDP socket. A server may respond with its TCP connection port. If there is no answer, the client starts its own server which will accept other clients.

The game logic is mostly event based. Only the events are passed to the clients at each frame, by serializing them to binary. So both the clients and the server keep the game knowledge.

The world is different in each game, it is procedurally generated with an "unlimited" size. Each world feature is discovered only as needed by either the server or the clients. The server discover the features affected by possible collisions and by explosions. The clients discovers the features visible on screen. The clients and servers share the seed for the noise generator, so they discover the same features. Only the destroyed features and new powerups are passed to the clients by the server as events.

Notes for future work:

* Tanks and turret position is updated every turn causing a lot of events and traffic.
  This may be solved by moving more logic client-side, so only changes in the direction of a tank trigger the broadcast of an event.
* The multiplayer looks like it slows down after a while.
  This may be caused by the serialization caches that can get pretty big.
  They may need to cleared and updated with a server/client sync.
* The framerate of the server and the clients are locked.
  Effectively slowing down everyone at the speed of the slowest computer.
* Implement zoom, this will be very useful for the small screen / phone version.
* The Android version crashes on some device (please test it and tell me if it works on yours).
* As the client can easily be modified, the server may need to be more restrictive against abusive orders, like firing way outside of the normal view range.
* The noise generation could be improved, there are still visible patterns.

Pull-Request: #1601
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: nitrpg: fix crash when the Reviews/Work requests return nothing
Jean Privat [Mon, 3 Aug 2015 18:35:20 +0000 (14:35 -0400)]
Merge: nitrpg: fix crash when the Reviews/Work requests return nothing

Nitrpg was down since last wednesday because of this. It's now back on track: http://nitlanguage.org/rpg/games/privat/nit

Since the listener didn't crash, no data were loss during the downtime.

Pull-Request: #1604
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: to_i behaviour coherent with parser
Jean Privat [Mon, 3 Aug 2015 18:35:17 +0000 (14:35 -0400)]
Merge: to_i behaviour coherent with parser

This PR changes the behaviour of `to_i` in Strings to support all the derivatives from the parser (hex, bin, oct and underscores)

The change in behaviour helps clean a bit of literal, though some more factorization is yet to come.

As for perfs, on Valgrind (`nitg src/nitg.nit`)

* Before : 14 289 384 832 Ir

* After : 14 348 036 981 Ir

A little slowdown, but acceptable imho since the function accepts more valid inputs and is safer.

Pull-Request: #1602
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: Remove memory leak in Ropes
Jean Privat [Mon, 3 Aug 2015 18:25:15 +0000 (14:25 -0400)]
Merge: Remove memory leak in Ropes

Early on, the `to_s` of a RopeBuffer was calling `dump_buffer`, which like to double the size of the buffered part after persisting.

By doing do, a simple program like the one submitted along with this PR was consuming an awful lot of RAM, which has the undesirable side-effect of freezing my machine after a few milliseconds of run.

By replacing it with the more memory-friendly `persist buffer`, all my troubles seem so far away !

Pull-Request: #1598
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agotests: Updated sav for base_error_literal
Lucas Bajolet [Fri, 31 Jul 2015 20:37:26 +0000 (16:37 -0400)]
tests: Updated sav for base_error_literal

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

8 years agosrc: Update literal to simplify the code
Lucas Bajolet [Fri, 31 Jul 2015 20:36:27 +0000 (16:36 -0400)]
src: Update literal to simplify the code

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

8 years agolib/standard/text: Update Text.to_i to parse all bases
Lucas Bajolet [Mon, 3 Aug 2015 14:50:10 +0000 (10:50 -0400)]
lib/standard/text: Update Text.to_i to parse all bases

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

8 years agolib/standard/text: Added is_int validation function to Text
Lucas Bajolet [Mon, 3 Aug 2015 14:50:01 +0000 (10:50 -0400)]
lib/standard/text: Added is_int validation function to Text

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

8 years agolib/standard/text: Added validation and conversion functions for dec/oct and bin
Lucas Bajolet [Fri, 31 Jul 2015 20:34:38 +0000 (16:34 -0400)]
lib/standard/text: Added validation and conversion functions for dec/oct and bin

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

8 years agolib/standard/text: Move and generalize remove_underscores to Text
Lucas Bajolet [Fri, 31 Jul 2015 20:33:57 +0000 (16:33 -0400)]
lib/standard/text: Move and generalize remove_underscores to Text

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

8 years agoversion 0.7.7 v0.7.7
Jean Privat [Mon, 3 Aug 2015 12:46:02 +0000 (08:46 -0400)]
version 0.7.7

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

8 years agocontrib/tinks: add README.md
Alexis Laferrière [Thu, 30 Jul 2015 12:14:24 +0000 (08:14 -0400)]
contrib/tinks: add README.md

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

8 years agocontrib/tinks: intro the android client
Alexis Laferrière [Thu, 30 Jul 2015 12:21:43 +0000 (08:21 -0400)]
contrib/tinks: intro the android client

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

8 years agocontrib/tinks: add icon source
Alexis Laferrière [Sat, 4 Jul 2015 19:20:09 +0000 (15:20 -0400)]
contrib/tinks: add icon source

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

8 years agolib/android: fix `just_went_down` to support secondary pointers
Alexis Laferrière [Thu, 30 Jul 2015 13:38:11 +0000 (09:38 -0400)]
lib/android: fix `just_went_down` to support secondary pointers

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

8 years agocontrib/tinks: add makefile
Alexis Laferrière [Thu, 30 Jul 2015 01:05:51 +0000 (21:05 -0400)]
contrib/tinks: add makefile

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

8 years agocontrib/tinks: intro art source
Alexis Laferrière [Thu, 30 Jul 2015 10:20:20 +0000 (06:20 -0400)]
contrib/tinks: intro art source

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

8 years agocontrib/tinks: add sounds
Alexis Laferrière [Thu, 2 Jul 2015 16:35:20 +0000 (12:35 -0400)]
contrib/tinks: add sounds

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

8 years agocontrib/tinks: add the client
Alexis Laferrière [Thu, 2 Jul 2015 00:14:08 +0000 (20:14 -0400)]
contrib/tinks: add the client

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

8 years agocontrib/tinks: add the server
Alexis Laferrière [Fri, 3 Jul 2015 21:14:36 +0000 (17:14 -0400)]
contrib/tinks: add the server

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

8 years agocontrib/tinks: add the game logic
Alexis Laferrière [Thu, 2 Jul 2015 00:13:49 +0000 (20:13 -0400)]
contrib/tinks: add the game logic

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

8 years agocontrib/tinks: intro git structure for tinks
Alexis Laferrière [Tue, 30 Jun 2015 21:29:04 +0000 (17:29 -0400)]
contrib/tinks: intro git structure for tinks

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

8 years agolib: intro gamnit::network
Alexis Laferrière [Thu, 2 Jul 2015 11:50:58 +0000 (07:50 -0400)]
lib: intro gamnit::network

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

8 years agoMerge: misc/vim: highlight the new Int literals
Jean Privat [Sat, 1 Aug 2015 01:15:07 +0000 (21:15 -0400)]
Merge: misc/vim: highlight the new Int literals

Add support for bin, oct and hex literals which are restrictive enough to detect invalid digits. Also accept `_` in all Int literals, and the suffixes `[iu]8|16|32` proposed by #1588.

Supports `_` in Float literals, it's not yet available but it can't be too far off.

Pull-Request: #1600
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agonitrpg: fix crash when the Reviews/Work requests return nothing
Alexandre Terrasa [Fri, 31 Jul 2015 15:03:51 +0000 (11:03 -0400)]
nitrpg: fix crash when the Reviews/Work requests return nothing

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoropes: Removed useless dump_buffer in to_s
Lucas Bajolet [Fri, 31 Jul 2015 14:16:32 +0000 (10:16 -0400)]
ropes: Removed useless dump_buffer in to_s

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

8 years agomisc/vim: highlight the new Int literals
Alexis Laferrière [Thu, 30 Jul 2015 13:54:11 +0000 (09:54 -0400)]
misc/vim: highlight the new Int literals

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

8 years agoMerge: jwrapper supports static properties, primitive arrays and generic parameters
Jean Privat [Thu, 30 Jul 2015 00:04:27 +0000 (20:04 -0400)]
Merge: jwrapper supports static properties, primitive arrays and generic parameters

This PR continues the work of #1578 and #1589. It improves jwrapper to support more features of the Java language: static functions and attributes, primitives arrays and generic parameters. The resulting generated wrapper of large Java namespaces is now usable with semi-global compilation!

Main changes:

* Wrap static functions and attributes as top-level methods.

* Generate a primitive array wrapper for each target class. By default, only wrap 1 dimension arrays, it's enough in most cases (see stats at the bottom).

* Resolve generic parameters and use the closest bound (only the first bound).

* Add JNI services to each classes.

* Jwrapper is now good enough to wrap the `java` and `org` namespace of the Java library
  and to use them in semi-global compilation. See the new example `java_api` to see it in action.

  The _full_ Java generated by this tool and by the FFI pass the basic semantic check of javac,
  but it still raise errors and warnings on illegal access of internal, protected or obsolete entities.
  This may need manual tweaking of the tool to block these cases, that information is not made available by the output of javap.

  Compiling `java_api` in separate compilation takes about 20 minutes and crashes at the compilation of the generated C code. More investigation is required to find the problem, but I suspect the C file of 132 mo generated by the FFI to manipulate the JNI.

What's to do next:
* Class hierarchy!
* Negative filtering of the target classes in a Jar archive.
* Filtering of methods to avoid obsolete ones? Or simply remove them manually after generation?
* vararg support.
* Revamp the `java` module and low-level types.

## Some stats on the Android lib example

Disabled functions before this PR:
* java_api.nit: 1448 / 12805
* android_api.nit: 1075 / 22084

Disabled functions now:
* java_api.nit: 5 / 14248 # From a multi-dimensional array
* java_api.nit: 29 / 14248 # From a vararg
* android_api.nit: 1 / 23138 # From a multi-dimensional array
* android_api.nit: 21 / 23138 # From a vararg

All the unknown multi-dimensional array: (these could be added by hand to the library)
* int[][]
* java.lang.String[][]
* java.lang.annotation.Annotation[][]

Pull-Request: #1599
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: A little fix to android::audio
Jean Privat [Thu, 30 Jul 2015 00:04:25 +0000 (20:04 -0400)]
Merge: A little fix to android::audio

As explained in PR #1587, there is a bit of a problem when making applications which runs on both linux and android about the loading of the sounds

This PR just reverse the order of the loading for the android audio API, so that if you want to use the sounds in the res folder for your android application, and the sounds in the assets folder for the linux application, you just have to create a new sound with its extension and it will work fine :)

Edit: It also enables the use of different sound formats between android and Linux

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

8 years agoMerge: contrib/rss_downloader: compressed feeds and report errors
Jean Privat [Thu, 30 Jul 2015 00:04:22 +0000 (20:04 -0400)]
Merge: contrib/rss_downloader: compressed feeds and report errors

This PR adds a few features to rss_downloader to support more RSS feeds. It can be configured to decompress the feed and to customize the tag to find the download link. The output has be improved, both on normal behavior and on errors.

As a bonus, add the program I used to debug the RSS feeds as an example for the `dom` module.

Pull-Request: #1590
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agocontrib/jwrapper examples: make the java_lib example lighter and test it in check
Alexis Laferrière [Wed, 29 Jul 2015 17:36:56 +0000 (13:36 -0400)]
contrib/jwrapper examples: make the java_lib example lighter and test it in check

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

8 years agocontrib/jwrapper examples: intro an example using the standard Java API
Alexis Laferrière [Tue, 28 Jul 2015 21:51:24 +0000 (17:51 -0400)]
contrib/jwrapper examples: intro an example using the standard Java API

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

8 years agocontrib/jwrapper tests: add 2 tests with static properties and a generic class
Alexis Laferrière [Mon, 27 Jul 2015 13:49:41 +0000 (09:49 -0400)]
contrib/jwrapper tests: add 2 tests with static properties and a generic class

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

8 years agocontrib/jwrapper examples: fix dependency of the queue example main rule
Alexis Laferrière [Mon, 27 Jul 2015 12:56:05 +0000 (08:56 -0400)]
contrib/jwrapper examples: fix dependency of the queue example main rule

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