nit.git
9 years agonitc: FFI and nitni use MModule::c_name
Alexis Laferrière [Tue, 16 Dec 2014 20:07:21 +0000 (15:07 -0500)]
nitc: FFI and nitni use MModule::c_name

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

9 years agoMerge: Use linker symbols to encode colors
Jean Privat [Tue, 13 Jan 2015 01:29:02 +0000 (20:29 -0500)]
Merge: Use linker symbols to encode colors

Genuine constant static variables are used to store the colors used in OO mechanisms.
This makes the compiler program slower since additional indirections are required to get the values.
It also produces a little bit larger executables since static memory has to store the colors.

This PR introduce a trick user in the original PRM that uses linker symbols to encode the colors.
It is not completely portable so it must be activated with the option `--colors-are-symbols`

For numbers (with the traditional nitc/nitc/nitc)
before: 0m7.544s
after: 0m7.228s (so -4%)

Pull-Request: #1093
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: GitHub api: Issues and PRs
Jean Privat [Tue, 13 Jan 2015 01:28:58 +0000 (20:28 -0500)]
Merge: GitHub api: Issues and PRs

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

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

9 years agoMerge: Android release mode sign and align the generated APK file
Jean Privat [Tue, 13 Jan 2015 01:28:50 +0000 (20:28 -0500)]
Merge: Android release mode sign and align the generated APK file

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

9 years agoMerge: More on Sockets and FinalizableOnce
Jean Privat [Tue, 13 Jan 2015 01:28:47 +0000 (20:28 -0500)]
Merge: More on Sockets and FinalizableOnce

Additionnal notes:
* `FinalizableOnce` will probably be the most common `Finalizable`, but it wouldn't cover all cases.
* Remove some unused features from `socket` to make it compatible with Android.
* Fix an illegal extern class by making it a pointer.
* Do not `exit 1` on socket error.

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

9 years agoMerge: neo4j: Introduce an API for graphs
Jean Privat [Tue, 13 Jan 2015 01:28:41 +0000 (20:28 -0500)]
Merge: neo4j: Introduce an API for graphs

You have waited for it. Now it comes: the Neo4j graph API.

## Features

* Customizable identification scheme: You have power on how IDs are generated and which property is used to store it. For the moment, only one scheme is provided: sequential IDs.
* Customizable storage mechanism: You have power on where and how your graph is saved. You can then reload your graph at will. For the moment, two storage medium are provided: Neo4j and JSON.
* Partial loading and saving: For when you do not want put all your eggs in one basket.
* Progression tracking: You can track the progression of a long-running operation (like saving thousands of nodes in a Neo4j database) and display it to your users the way you want.

## What is included

### The API itself
* progression: Add an API for progression tracking.
* neo4j: Add an API for graphs.
* neo4j/graph: Add node removal methods.
* neo4j/graph: Add optimization methods.

### Neo4j as a storage mechanism
* neo4j/graph: Add Neo4j as a storage mechanism.

### JSON storage mechanism
* json: Factorize the trivial implementation of `to_json`.
* stream: Optimize `StringIStream.read_all`
* neo4j/graph: Add a JSON storage mechanism.
* neo4j/graph: Enlarge in advance when loading from JSON.

### Sequential identification scheme
* neo4j/graph: Add a sequential identification scheme.
* neo4j/graph: Optimize some services of `SequentialNodeCollection`.
* neo4j/graph: Implement optimization services of `SequentialNodeCollection`.

### Garbage collection :smile:
* neo4j: Remove `json_store`.

## Comming soon in a future PR near you
* Refactoring of `/src/neo.nit` and of `neo_doxygen` to use the new API.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: Fix more warnings
Jean Privat [Tue, 13 Jan 2015 01:28:35 +0000 (20:28 -0500)]
Merge: Fix more warnings

And some more....

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

9 years agoman: document `--colors-are-symbols` in nitc
Jean Privat [Sat, 10 Jan 2015 19:53:46 +0000 (14:53 -0500)]
man: document `--colors-are-symbols` in nitc

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

fixod

9 years agocompiler: add `Platform::supports_linker_script`
Jean Privat [Sat, 10 Jan 2015 20:28:00 +0000 (15:28 -0500)]
compiler: add `Platform::supports_linker_script`

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

9 years agocompiler: add early `Compiler::target_platform` with a non-nullable type
Jean Privat [Sat, 10 Jan 2015 20:23:27 +0000 (15:23 -0500)]
compiler: add early `Compiler::target_platform` with a non-nullable type

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

9 years agocompiler: use linker symbols to encode colors
Jean Privat [Sat, 10 Jan 2015 15:46:40 +0000 (10:46 -0500)]
compiler: use linker symbols to encode colors

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

9 years agolib/android: add a README file to the project
Alexis Laferrière [Sat, 10 Jan 2015 14:23:13 +0000 (09:23 -0500)]
lib/android: add a README file to the project

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

9 years agonitc/android: sign and align the APK file in release mode
Alexis Laferrière [Sat, 10 Jan 2015 14:21:28 +0000 (09:21 -0500)]
nitc/android: sign and align the APK file in release mode

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

9 years agonitc/android: set the icon for the APK as expected by the Play Store
Alexis Laferrière [Sat, 10 Jan 2015 14:20:30 +0000 (09:20 -0500)]
nitc/android: set the icon for the APK as expected by the Play Store

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

9 years agonitc: `exec_and_check` print the command on verbose level > 1
Alexis Laferrière [Sat, 10 Jan 2015 14:09:49 +0000 (09:09 -0500)]
nitc: `exec_and_check` print the command on verbose level > 1

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

9 years agocompiler: add an aditionnal linker_script file
Jean Privat [Sat, 10 Jan 2015 15:34:30 +0000 (10:34 -0500)]
compiler: add an aditionnal linker_script file

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

9 years agoMerge: contrib/nitiwiki: fixes nitiwiki warnings
Jean Privat [Mon, 12 Jan 2015 10:30:11 +0000 (05:30 -0500)]
Merge: contrib/nitiwiki: fixes nitiwiki warnings

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

9 years agoMerge: GitHub api: handles labels and milestones
Jean Privat [Mon, 12 Jan 2015 10:30:06 +0000 (05:30 -0500)]
Merge: GitHub api: handles labels and milestones

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

9 years agolib/github: handles pull requests
Alexandre Terrasa [Mon, 12 Jan 2015 08:53:17 +0000 (09:53 +0100)]
lib/github: handles pull requests

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

9 years agolib/github: handles issues
Alexandre Terrasa [Mon, 12 Jan 2015 08:37:35 +0000 (09:37 +0100)]
lib/github: handles issues

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

9 years agolib/symbol: fixes old style inits
Alexandre Terrasa [Fri, 12 Dec 2014 20:11:55 +0000 (15:11 -0500)]
lib/symbol: fixes old style inits

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

9 years agolib/scene2d: fixes documentation warnings
Alexandre Terrasa [Fri, 12 Dec 2014 20:10:39 +0000 (15:10 -0500)]
lib/scene2d: fixes documentation warnings

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

9 years agolib/scene2d: fixes useless empty init
Alexandre Terrasa [Fri, 12 Dec 2014 20:10:24 +0000 (15:10 -0500)]
lib/scene2d: fixes useless empty init

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

9 years agolib/opts: fixes documentation warnings
Alexandre Terrasa [Sat, 13 Dec 2014 21:00:30 +0000 (16:00 -0500)]
lib/opts: fixes documentation warnings

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

9 years agolib/opts: fixes old style inits
Alexandre Terrasa [Sat, 13 Dec 2014 20:57:38 +0000 (15:57 -0500)]
lib/opts: fixes old style inits

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

9 years agolib/nitcc_runtime: fixes old style init
Alexandre Terrasa [Fri, 12 Dec 2014 20:08:33 +0000 (15:08 -0500)]
lib/nitcc_runtime: fixes old style init

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

9 years agolib/ini: fixes useless local variables
Alexandre Terrasa [Fri, 12 Dec 2014 20:08:18 +0000 (15:08 -0500)]
lib/ini: fixes useless local variables

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

9 years agolib/ini: fixes old style inits
Alexandre Terrasa [Fri, 12 Dec 2014 20:08:02 +0000 (15:08 -0500)]
lib/ini: fixes old style inits

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

9 years agolib/filter_stream: fixes old style inits
Alexandre Terrasa [Mon, 15 Dec 2014 13:21:54 +0000 (08:21 -0500)]
lib/filter_stream: fixes old style inits

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

9 years agolib/filter_stream: fixes whitespaces.
Alexandre Terrasa [Fri, 12 Dec 2014 20:07:19 +0000 (15:07 -0500)]
lib/filter_stream: fixes whitespaces.

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

9 years agolib/curl: fixes old style inits
Alexandre Terrasa [Fri, 12 Dec 2014 22:35:28 +0000 (17:35 -0500)]
lib/curl: fixes old style inits

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

9 years agolib/bucketed_games: fixes useless empty init
Alexandre Terrasa [Fri, 12 Dec 2014 20:06:13 +0000 (15:06 -0500)]
lib/bucketed_games: fixes useless empty init

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

9 years agolib/array_debug: fixes documentation warnings
Alexandre Terrasa [Fri, 12 Dec 2014 20:05:51 +0000 (15:05 -0500)]
lib/array_debug: fixes documentation warnings

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

9 years agonitc: fix indentation of `exec_and_check`
Alexis Laferrière [Fri, 9 Jan 2015 20:21:13 +0000 (15:21 -0500)]
nitc: fix indentation of `exec_and_check`

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

9 years agocompiler: generalize `const_color` in entities
Jean Privat [Sat, 10 Jan 2015 15:29:37 +0000 (10:29 -0500)]
compiler: generalize `const_color` in entities

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

9 years agoMerge: Enforce namespace rules
Jean Privat [Sat, 10 Jan 2015 02:31:30 +0000 (21:31 -0500)]
Merge: Enforce namespace rules

Enforce rules indicated in #1047.

So, having homonymous public modules and classes in a same project raises an error.
In the current code there was no conflicting modules. It is not surprising because for a long time the compilers refused homonymous modules even in different projects.
There was only 2 conflicting classes (on a total of 3640). This is more a good surprise since I expected a lot of conflicts. It is some kind of prof that the proposed policy is not that crazy. The two pairs of conflicting classes were `UnicodeChar` in `lib/string_experimentations/utf8.nit` and `lib/string_experimentations/utf8_noindex.nit`, and `Frame` in `naive_interpreter` and `abstract_compiler`. Some commits in the PR rename one of each pair to solve the conflicts.

For public properties, the proposed rule is to have a unique full-name "project::class::name".
There was 11 conflicts, again, it is far less than I expected.
Two of these conflict are resolved in some commits.
The other 9 are currently left as is (and the displayed error is in fact a warning).
All these remaining conflicts are a variation of the same pattern: homonymous options in refinements of ToolContext for different tools. Eg `opt_rta` for `nitmetrics` and for `nitc`.
I am not sure what is the correct way to solve these since the conflict is not only in the name but also in the behavior (a refinement of those two modules will have a broken option parsing). Maybe, behind the name conflict, there is also a bad model that misuses class refinement.

Pull-Request: #1069
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: nitdoc: do not repeat intro comment in mpropdef lists
Jean Privat [Sat, 10 Jan 2015 02:31:14 +0000 (21:31 -0500)]
Merge: nitdoc: do not repeat intro comment in mpropdef lists

Fixes #1085

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

9 years agotest_docdown: rename `test_markdown` as `do_test_markdown`
Jean Privat [Sun, 28 Dec 2014 04:18:42 +0000 (23:18 -0500)]
test_docdown: rename `test_markdown` as `do_test_markdown`

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

9 years agopep8analysis: rename `run` in `pep8analysis_web` as `run_web`
Jean Privat [Sun, 28 Dec 2014 04:16:28 +0000 (23:16 -0500)]
pep8analysis: rename `run` in `pep8analysis_web` as `run_web`

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

9 years agomodelize: check full-name conflicts for properties
Jean Privat [Sun, 28 Dec 2014 04:07:02 +0000 (23:07 -0500)]
modelize: check full-name conflicts for properties

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

9 years agomodelize: check full-name conflicts in projects for modules and classes
Jean Privat [Sun, 28 Dec 2014 04:02:00 +0000 (23:02 -0500)]
modelize: check full-name conflicts in projects for modules and classes

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

9 years agoMerge: More jwrapper: fix terminology and add a single feature from the TODO list
Jean Privat [Fri, 9 Jan 2015 03:03:43 +0000 (22:03 -0500)]
Merge: More jwrapper: fix terminology and add a single feature from the TODO list

More clean up on jwrapper, improve terminology and add one feature from #794.

Pull-Request: #1086
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Frédéric Vachon <fredvac@gmail.com>

9 years agocontrib/jwrapper: rename the `types` module to `model`
Alexis Laferrière [Wed, 7 Jan 2015 16:10:08 +0000 (11:10 -0500)]
contrib/jwrapper: rename the `types` module to `model`

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

9 years agocontrib/jwrapper: revamp the README file
Alexis Laferrière [Tue, 6 Jan 2015 19:05:57 +0000 (14:05 -0500)]
contrib/jwrapper: revamp the README file

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

9 years agonitdoc: do not repeat intro comment in mpropdef lists
Alexandre Terrasa [Thu, 8 Jan 2015 14:01:19 +0000 (15:01 +0100)]
nitdoc: do not repeat intro comment in mpropdef lists

Fixes #1085

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

9 years agolib/github: handles milestones
Alexandre Terrasa [Sat, 13 Dec 2014 02:02:02 +0000 (21:02 -0500)]
lib/github: handles milestones

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

9 years agolib/github: handles labels
Alexandre Terrasa [Thu, 8 Jan 2015 12:53:28 +0000 (13:53 +0100)]
lib/github: handles labels

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

9 years agoMerge: null as receiver
Jean Privat [Thu, 8 Jan 2015 02:49:57 +0000 (21:49 -0500)]
Merge: null as receiver

Accepts literal `null` as a receiver of `==`, `!=` and `is_same_instance`.

This could help to finish #1041

Does people need other methods of Object available for `null`?

Pull-Request: #1082
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Etienne M. Gagnon <egagnon@j-meg.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

9 years agoMerge: Less fixme and todo
Jean Privat [Thu, 8 Jan 2015 02:49:52 +0000 (21:49 -0500)]
Merge: Less fixme and todo

Looked at http://jenkins.gresil.org/jenkins/job/nit/tasks and did some work.

Pull-Request: #1077
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

9 years agocontrib/jwrapper: remove double spaces in generated code
Alexis Laferrière [Tue, 6 Jan 2015 18:51:32 +0000 (13:51 -0500)]
contrib/jwrapper: remove double spaces in generated code

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

9 years agocontrib/jwrapper: convert style of getters and setters to Nit
Alexis Laferrière [Tue, 6 Jan 2015 18:50:49 +0000 (13:50 -0500)]
contrib/jwrapper: convert style of getters and setters to Nit

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

9 years agocontrib/jwrapper: remove code left over from array hack
Alexis Laferrière [Tue, 6 Jan 2015 18:48:53 +0000 (13:48 -0500)]
contrib/jwrapper: remove code left over from array hack

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

9 years agocontrib/jwrapper: rename `NitModule::value` to `name`
Alexis Laferrière [Tue, 6 Jan 2015 17:21:06 +0000 (12:21 -0500)]
contrib/jwrapper: rename `NitModule::value` to `name`

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

9 years agocontrib/jwrapper: rename JReturnAndParams to JavaMethod
Alexis Laferrière [Tue, 6 Jan 2015 17:18:32 +0000 (12:18 -0500)]
contrib/jwrapper: rename JReturnAndParams to JavaMethod

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

9 years agoMerge: jwrapper: use the latest Java collections and other updates
Jean Privat [Wed, 7 Jan 2015 02:07:11 +0000 (21:07 -0500)]
Merge: jwrapper: use the latest Java collections and other updates

Simplify a lot the code, but will strike a single item from the TODO list #794.

@Freddrickk j'efface toute la logique de gestion des arrays car #1079 wrap les array Java. Est-ce que j'ai ai trop enlevé, ou oublié?

Pull-Request: #1083
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Frédéric Vachon <fredvac@gmail.com>

9 years agoMerge: No abort() on bad execvp
Jean Privat [Wed, 7 Jan 2015 02:06:59 +0000 (21:06 -0500)]
Merge: No abort() on bad execvp

When a bad command is passed to Process, the child-process will `C-abort()`, displaying frightening messages on the screen and causing confusion to the user.
Instead, just `_exit(127)` to terminate the child silently and let the parent do its things.

TODO better error management to not lose the error of the failed `execvp` system call.

Pull-Request: #1074
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

9 years agoMerge: Tools works with groups
Jean Privat [Wed, 7 Jan 2015 02:05:51 +0000 (21:05 -0500)]
Merge: Tools works with groups

Make Nit tools more POLA when projects (or groups) are given on the command line.

eg. people using `nitunit ../lib/mylib` may expect that all the unit tests of the lib are executed, not just those from the default module `../lib/mylib/mylib.nit` (that often is basically an empty bottom module)

So this PR introduces `parse_full` in the loader that loads and returns all the modules of given groups, then adapt most tools to use `parse_full`.

No more crazy shell pipelines with `nitls` or `find` to use nitunit, nitpick and other on all the modules of your libs or programs.

Pull-Request: #1070
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

9 years agotests: yet another update of sav/test_new_native_alt1.res
Jean Privat [Sun, 4 Jan 2015 03:28:56 +0000 (22:28 -0500)]
tests: yet another update of sav/test_new_native_alt1.res

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

9 years agocomplier: `--direct-call-monomorph` works with constructors without initializers
Jean Privat [Sun, 4 Jan 2015 03:25:26 +0000 (22:25 -0500)]
complier: `--direct-call-monomorph` works with constructors without initializers

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

9 years agocompiler: fix the signature of `add_extern`
Jean Privat [Sat, 3 Jan 2015 21:48:37 +0000 (16:48 -0500)]
compiler: fix the signature of `add_extern`

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

9 years agoloader: having no `module` clause is not a warning
Jean Privat [Sat, 3 Jan 2015 21:37:41 +0000 (16:37 -0500)]
loader: having no `module` clause is not a warning

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

9 years agocontrib/jwrapper: rename field to property
Alexis Laferrière [Tue, 6 Jan 2015 13:25:58 +0000 (08:25 -0500)]
contrib/jwrapper: rename field to property

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

9 years agocontrib/jwrapper: divide Makefile into more rules
Alexis Laferrière [Tue, 6 Jan 2015 13:24:29 +0000 (08:24 -0500)]
contrib/jwrapper: divide Makefile into more rules

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

9 years agocontrib/jwrapper: update README and remove TODO list as it is now on github
Alexis Laferrière [Tue, 6 Jan 2015 00:17:02 +0000 (19:17 -0500)]
contrib/jwrapper: update README and remove TODO list as it is now on github

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

9 years agocontrib/jwrapper: do not add `redef type SELF...` to generated extern classes
Alexis Laferrière [Tue, 6 Jan 2015 00:04:00 +0000 (19:04 -0500)]
contrib/jwrapper: do not add `redef type SELF...` to generated extern classes

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

9 years agocontrib/jwrapper: search for more extern classes
Alexis Laferrière [Tue, 6 Jan 2015 00:02:39 +0000 (19:02 -0500)]
contrib/jwrapper: search for more extern classes

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

9 years agocontrib/jwrapper: default name of Java primitive arrays are Java?Array
Alexis Laferrière [Tue, 6 Jan 2015 00:19:06 +0000 (19:19 -0500)]
contrib/jwrapper: default name of Java primitive arrays are Java?Array

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

9 years agocontrib/jwrapper: remove hack to copy arrays
Alexis Laferrière [Mon, 5 Jan 2015 19:50:25 +0000 (14:50 -0500)]
contrib/jwrapper: remove hack to copy arrays

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

9 years agoMerge: Reject arrays of null
Jean Privat [Tue, 6 Jan 2015 02:02:23 +0000 (21:02 -0500)]
Merge: Reject arrays of null

The type `Array[null]` is not exprimable directly, and this is a good thing because it is and useless type and is broken in the compilers (except with `--erasure` for obvious reasons). However, it was still possible to create such a buggy type with literal arrays. eg `[null, null]`.

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

9 years agoMerge: Do compilation
Jean Privat [Tue, 6 Jan 2015 02:02:18 +0000 (21:02 -0500)]
Merge: Do compilation

refactorization: do in the Compiler classes what was in the ModelBuilder

Just add a method `AbstractCompiler::do_compiling` that contains what the various `ModelBuilder::run_*_compiler` where doing.
This simplifies `separate_erasure_compiler` since most the the code is just inherited.
The specific type handling code is moved into a separate method `compile_types`

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

9 years agoMerge: Lazy semantize
Jean Privat [Tue, 6 Jan 2015 02:02:04 +0000 (21:02 -0500)]
Merge: Lazy semantize

Prof of concept for lazy semantic analysis of the bodies of methods.
It means that the bodies of methods can be analysed only at the first request of the associated AST node.

It is disabled by default (see bellow) but can be enabled with --sloppy

It may improves the speed of some tools, especially the interpreter (and the VM).

For `nit hello_world.nit`.
before: 0m0.260s
after (lazy): 0m0.188s
explication: `standard` remains mostly unanalysed

For `nit nit.nit`
before: 0m1.824s
after: 0m1.060s
explication: `src/` and libs remain mostly unanalysed

For `nit nit.nit ../tests/base_simple3.nit`
before: 0m3.868s
after: 0m3.464s
explication: still some parts of `src/` and libs not analysed

However. there is some issues that remains

* `nitc` will crash with it because coloration is done before `super` are collected
* there is not always a gain, most tools need the full analysis of each method, thus doing the analysis in a lazy way can only degrade the performances.
* this could allow the interpreter to happily execute (or the compiler to compile) statically invalid programs. Eg. a bad identifier in a unused method will be undetected with the lazy approach.
* testing in `tests/` will be difficult because the error messages will change (see previous point)

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

9 years agotools: use `parse_full` in nitdoc, nitlight, nitmetrics, nitpick, nituml, and nitunit
Jean Privat [Sun, 28 Dec 2014 05:30:34 +0000 (00:30 -0500)]
tools: use `parse_full` in nitdoc, nitlight, nitmetrics, nitpick, nituml, and nitunit

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

9 years agoMerge: Support for Java arrays, Java libs on Android and Google Cardboard head tracking
Jean Privat [Mon, 5 Jan 2015 21:29:15 +0000 (16:29 -0500)]
Merge: Support for Java arrays, Java libs on Android and Google Cardboard head tracking

Use the same approach to copy the "libs" dir to the Android project than the "res" dir.

Extern Java types for primitive arrays is a bit tricky to convert to JNI format. For example, `Object[]` in Java is represented by `[Ljava.lang.Object;` in JNI format, and `int[]` is `[I`.

Add some primitive Java arrays, will add more as needed. Will also need to update jwrapper to use those.

The last commit hints at my next demo. It is mostly generated with jwrapper.

Pull-Request: #1079
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

9 years agoMerge: Better & playable Chainz of Friendz on Android, and offer landscape & portrait...
Jean Privat [Mon, 5 Jan 2015 21:26:23 +0000 (16:26 -0500)]
Merge: Better & playable Chainz of Friendz on Android, and offer landscape & portrait configs

Based on #1075, so ignore the first 4 commits.

@privat You will like this one.

Credits for the artwork of Friends were missing. Sam Hocevar's name still appeared in each source file because he also created the licence used by Friendz.

Manage zooming in Friendz itselt (this service may be extracted later) and clean up all reference to Mnit automatic zoom.

Still TODO:
* Saving progress using the data_store.
* Deactivate fullscreen mode, but it causes issues with Mnit inputs.
* Somehow adapt the width of the background image or content to the device aspect ratio.

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

9 years agoMerge: More OpenGL ES 2.0 features
Jean Privat [Mon, 5 Jan 2015 21:24:18 +0000 (16:24 -0500)]
Merge: More OpenGL ES 2.0 features

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

9 years agoandroid: add the Google cardboard support module
Alexis Laferrière [Sun, 4 Jan 2015 08:00:14 +0000 (03:00 -0500)]
android: add the Google cardboard support module

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

9 years agoandroid: copy user libs folder to the android project
Alexis Laferrière [Fri, 26 Dec 2014 20:01:48 +0000 (15:01 -0500)]
android: copy user libs folder to the android project

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

9 years agolib/java: add some Java collections
Alexis Laferrière [Sun, 4 Jan 2015 07:19:06 +0000 (02:19 -0500)]
lib/java: add some Java collections

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

9 years agocontrib/friendz: do not show a cursor
Alexis Laferrière [Mon, 5 Jan 2015 18:17:16 +0000 (13:17 -0500)]
contrib/friendz: do not show a cursor

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

9 years agocontrib/friendz: use the correct next level on "continue"
Alexis Laferrière [Mon, 5 Jan 2015 18:17:01 +0000 (13:17 -0500)]
contrib/friendz: use the correct next level on "continue"

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

9 years agocontrib/friendz: use `app:data_store` to keep best scores
Alexis Laferrière [Mon, 5 Jan 2015 17:42:23 +0000 (12:42 -0500)]
contrib/friendz: use `app:data_store` to keep best scores

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

9 years agocontrib/friendz: gitignore and clean the res folder
Alexis Laferrière [Mon, 5 Jan 2015 16:31:04 +0000 (11:31 -0500)]
contrib/friendz: gitignore and clean the res folder

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

9 years agoMerge: no_warning: modules without a module clause do not cause `missing-doc`
Jean Privat [Mon, 5 Jan 2015 16:14:53 +0000 (11:14 -0500)]
Merge: no_warning: modules without a module clause do not cause `missing-doc`

Rationale: the presence of a `module` clause is a good heuristic to
discriminate quick and dirty prototypes from nice and clean modules

Pull-Request: #1078
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

9 years agoMerge: Android: extract input_events and clean up
Jean Privat [Mon, 5 Jan 2015 16:14:51 +0000 (11:14 -0500)]
Merge: Android: extract input_events and clean up

Extract `input_events` from `android_app` so it is independant of the display part of Mnit. It now relies only on `mnit_input`, which will probably be kept around for Gamnit.

The extraction has been organized in three commits for easier review:
* Extract the code with minimal modifications.
* Update the style of the new module (this may be the first module that used the FFI, its style was outdated).
* Improve the doc and fix warnings in the new module.

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

9 years agoMerge: Less CC warnings
Jean Privat [Mon, 5 Jan 2015 16:14:43 +0000 (11:14 -0500)]
Merge: Less CC warnings

Fix two warnings in the C code.

Pull-Request: #1073
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

9 years agotests: add base_null.nit
Jean Privat [Mon, 5 Jan 2015 03:02:18 +0000 (22:02 -0500)]
tests: add base_null.nit

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

9 years agoseparate_compiler: `shortcut_equate` works on `is_same_instance`
Jean Privat [Mon, 5 Jan 2015 03:01:20 +0000 (22:01 -0500)]
separate_compiler: `shortcut_equate` works on `is_same_instance`

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

9 years agotyping&engines: accept `is_same_instance` on `null`
Jean Privat [Mon, 5 Jan 2015 03:00:27 +0000 (22:00 -0500)]
typing&engines: accept `is_same_instance` on `null`

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

9 years agorta: `live_targets` do not crash when the receiver is null
Jean Privat [Mon, 5 Jan 2015 02:55:06 +0000 (21:55 -0500)]
rta: `live_targets` do not crash when the receiver is null

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

9 years agocompiler: accept `null` as a *maybenull* receiver
Jean Privat [Mon, 5 Jan 2015 02:54:01 +0000 (21:54 -0500)]
compiler: accept `null` as a *maybenull* receiver

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

9 years agotyping: accept `null` as a receiver for some methods of Object
Jean Privat [Mon, 5 Jan 2015 02:52:00 +0000 (21:52 -0500)]
typing: accept `null` as a receiver for some methods of Object

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

9 years agotyping: remove useless error on null receiver. `get_method` already do it.
Jean Privat [Mon, 5 Jan 2015 02:22:26 +0000 (21:22 -0500)]
typing: remove useless error on null receiver. `get_method` already do it.

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

9 years agocompiler: create var in `shortcut_equate` only if needed
Jean Privat [Mon, 5 Jan 2015 02:18:19 +0000 (21:18 -0500)]
compiler: create var in `shortcut_equate` only if needed

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

9 years agotests: extends base_array to test `[null, null]`
Jean Privat [Sun, 4 Jan 2015 21:40:13 +0000 (16:40 -0500)]
tests: extends base_array to test `[null, null]`

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

9 years agotyping: reject literal arrays made of `null` (because they are untypable)
Jean Privat [Sun, 4 Jan 2015 21:39:28 +0000 (16:39 -0500)]
typing: reject literal arrays made of `null` (because they are untypable)

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

9 years agoJava FFI: support array in extern types
Alexis Laferrière [Sun, 4 Jan 2015 07:16:09 +0000 (02:16 -0500)]
Java FFI: support array in extern types

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

9 years agomnit: completely remove `mnit_zoom`
Alexis Laferrière [Sat, 3 Jan 2015 18:15:12 +0000 (13:15 -0500)]
mnit: completely remove `mnit_zoom`

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

9 years agocontrib/friendz: manage zoom at the application level
Alexis Laferrière [Sat, 3 Jan 2015 18:04:46 +0000 (13:04 -0500)]
contrib/friendz: manage zoom at the application level

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

9 years agomnit: update all clients of `mnit_android` with custom orientations
Alexis Laferrière [Sat, 3 Jan 2015 17:45:49 +0000 (12:45 -0500)]
mnit: update all clients of `mnit_android` with custom orientations

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

9 years agono_warning: modules without a module clause do not cause `missing-doc` warnings
Jean Privat [Sat, 3 Jan 2015 22:03:38 +0000 (17:03 -0500)]
no_warning: modules without a module clause do not cause `missing-doc` warnings

Rationale: the presence of a `module` clause is a good heuristic to
discriminate quick and dirty prototypes from nice and clean modules

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