nit.git
8 years agoMerge: Personalized tests
Jean Privat [Mon, 29 Jun 2015 12:20:56 +0000 (08:20 -0400)]
Merge: Personalized tests

Extends the tests.sh infrastructure to be configurable by os and hostname

* handle `sav/$os`, `sav/$os/fixme`, `sav/$hostname` and `sav/$hostname/fixme` sav directories that can contains specific results `.res` when there is an expected divergence on results per architecture or machine
* specific `$hostname.skip` file to skip tests on a host basis (`$os.skip` files did already exists to filter at the architecture level)
* additional `sav/$foo/cc.skip` and `sav/$foo/exec.skip` where foo can be engines, os or hostname to fine-tune more things

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

8 years agoMerge: Opportunity templates and pizzas
Jean Privat [Mon, 29 Jun 2015 12:20:50 +0000 (08:20 -0400)]
Merge: Opportunity templates and pizzas

Adds templates to the Opportunity meetup creation page. The default software provides: 4 kinds of pizzas, 5 days work week and 7 days week. The software customized for xymus.net also provides: pizzas special LATECE and meeting hours for UQAM Sciences.

It is already available at http://xymus.net/opportunity/.

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

8 years agoMerge: Third batch of rosettacode
Jean Privat [Mon, 29 Jun 2015 12:20:43 +0000 (08:20 -0400)]
Merge: Third batch of rosettacode

Cleaning, small fixes and/or improved tests

Pull-Request: #1535
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Audio API implementation for linux
Jean Privat [Mon, 29 Jun 2015 12:20:36 +0000 (08:20 -0400)]
Merge: Audio API implementation for linux

fixes #1527.
The ideal solution would still be to implement SDL sounds but for now, this will be sufficient

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

8 years agoMerge: example: add arithmetic mean example from rosetta code
Jean Privat [Mon, 29 Jun 2015 12:20:29 +0000 (08:20 -0400)]
Merge: example: add arithmetic mean example from rosetta code

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

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

8 years agolib&src/serialization: use deserialize_class_intern to avoid conflicts with custom...
Alexis Laferrière [Mon, 29 Jun 2015 10:52:41 +0000 (06:52 -0400)]
lib&src/serialization: use deserialize_class_intern to avoid conflicts with custom implementations

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

8 years agosrc/serialization_phase: fix searching for `deserialize_class` in `Deserializer`
Alexis Laferrière [Mon, 29 Jun 2015 10:51:12 +0000 (06:51 -0400)]
src/serialization_phase: fix searching for `deserialize_class` in `Deserializer`

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

8 years agolib/json: there's no need for the length attribute in the generated JSON
Alexis Laferrière [Mon, 29 Jun 2015 10:44:37 +0000 (06:44 -0400)]
lib/json: there's no need for the length attribute in the generated JSON

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

8 years agolib/json: clear error list on each call to deserialize
Alexis Laferrière [Mon, 29 Jun 2015 02:14:46 +0000 (22:14 -0400)]
lib/json: clear error list on each call to deserialize

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

8 years agolib/json: improve the human readable version of JsonParseError
Alexis Laferrière [Mon, 29 Jun 2015 01:31:26 +0000 (21:31 -0400)]
lib/json: improve the human readable version of JsonParseError

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

8 years agolib/json: the `__kind` attribute is optional
Alexis Laferrière [Mon, 29 Jun 2015 01:35:48 +0000 (21:35 -0400)]
lib/json: the `__kind` attribute is optional

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

8 years agolib/json: parse errors are moved to deserializer errors
Alexis Laferrière [Mon, 29 Jun 2015 01:35:14 +0000 (21:35 -0400)]
lib/json: parse errors are moved to deserializer errors

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

8 years agolib/json: serialization is more tolerant to errors
Alexis Laferrière [Mon, 29 Jun 2015 00:47:43 +0000 (20:47 -0400)]
lib/json: serialization is more tolerant to errors

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

8 years agolib/json: object __id is optional
Alexis Laferrière [Mon, 29 Jun 2015 00:47:17 +0000 (20:47 -0400)]
lib/json: object __id is optional

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

8 years agosrc/serialization_phase: generate code to be more tolerant to errors
Alexis Laferrière [Mon, 29 Jun 2015 02:09:08 +0000 (22:09 -0400)]
src/serialization_phase: generate code to be more tolerant to errors

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

8 years agolib/serialization: deserialize_class should not be public
Alexis Laferrière [Mon, 29 Jun 2015 02:10:34 +0000 (22:10 -0400)]
lib/serialization: deserialize_class should not be public

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

8 years agolib/serialization: prepare to collect errors and customize reactions to them
Alexis Laferrière [Tue, 26 May 2015 09:57:14 +0000 (05:57 -0400)]
lib/serialization: prepare to collect errors and customize reactions to them

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

8 years agosrc/serialization: use multiline strings
Alexis Laferrière [Tue, 26 May 2015 00:51:44 +0000 (20:51 -0400)]
src/serialization: use multiline strings

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

8 years agotests: remove undefined tests results that work without the hacks
Alexis Laferrière [Fri, 26 Jun 2015 23:03:28 +0000 (19:03 -0400)]
tests: remove undefined tests results that work without the hacks

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

8 years agosrc/niti: mkdir the compile dir only if it doesn't exist
Alexis Laferrière [Fri, 26 Jun 2015 23:02:49 +0000 (19:02 -0400)]
src/niti: mkdir the compile dir only if it doesn't exist

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

8 years agosrc/niti: use a real NativeString
Alexis Laferrière [Fri, 26 Jun 2015 23:10:52 +0000 (19:10 -0400)]
src/niti: use a real NativeString

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

8 years agosrc/niti: remove hack on NativeFile
Alexis Laferrière [Fri, 26 Jun 2015 23:12:33 +0000 (19:12 -0400)]
src/niti: remove hack on NativeFile

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

8 years agosrc/niti: remove intern implementations to extern methods
Alexis Laferrière [Fri, 26 Jun 2015 21:18:45 +0000 (17:18 -0400)]
src/niti: remove intern implementations to extern methods

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

8 years agocontrib/opportunité: prevent useless xss exploit in meetup confirmation
Alexis Laferrière [Thu, 25 Jun 2015 20:33:18 +0000 (16:33 -0400)]
contrib/opportunité: prevent useless xss exploit in meetup confirmation

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

8 years agonitdoc: introduce DocCommand `list`
Alexandre Terrasa [Thu, 4 Jun 2015 15:35:12 +0000 (11:35 -0400)]
nitdoc: introduce DocCommand `list`

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

8 years agomarkdown: add_wikilink accept a TokenWikiLink so clients can use the location
Alexandre Terrasa [Sat, 6 Jun 2015 22:05:01 +0000 (18:05 -0400)]
markdown: add_wikilink accept a TokenWikiLink so clients can use the location

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

8 years agomarkdown: fix token location in multilines input
Alexandre Terrasa [Sat, 6 Jun 2015 22:04:11 +0000 (18:04 -0400)]
markdown: fix token location in multilines input

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

8 years agoloader: set correct location for README files
Alexandre Terrasa [Thu, 4 Jun 2015 15:32:08 +0000 (11:32 -0400)]
loader: set correct location for README files

Also correct comment for line_starts

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

8 years agodoc_down: introduce `synopsis` service
Alexandre Terrasa [Fri, 22 May 2015 03:16:08 +0000 (23:16 -0400)]
doc_down: introduce `synopsis` service

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

8 years agodoc_down: make processors visibles from other modules
Alexandre Terrasa [Wed, 24 Jun 2015 20:24:32 +0000 (16:24 -0400)]
doc_down: make processors visibles from other modules

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

8 years agonitdoc: update tests for svg
Alexandre Terrasa [Thu, 11 Jun 2015 07:46:27 +0000 (03:46 -0400)]
nitdoc: update tests for svg

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

8 years agonitdoc: convert dot to svg instead of png
Alexandre Terrasa [Thu, 11 Jun 2015 06:57:32 +0000 (02:57 -0400)]
nitdoc: convert dot to svg instead of png

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

8 years agobench_nitdoc: allow other git ref than origin/master
Alexandre Terrasa [Thu, 11 Jun 2015 07:40:54 +0000 (03:40 -0400)]
bench_nitdoc: allow other git ref than origin/master

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

8 years agoexample: add arithmetic mean example from rosetta code
Alexandre Terrasa [Wed, 24 Jun 2015 18:45:38 +0000 (14:45 -0400)]
example: add arithmetic mean example from rosetta code

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

8 years agonitdoc: make `DocComposite::title` writable
Alexandre Terrasa [Tue, 9 Jun 2015 20:34:41 +0000 (16:34 -0400)]
nitdoc: make `DocComposite::title` writable

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

8 years agonitdoc: remove `well` around level 2 titles
Alexandre Terrasa [Fri, 22 May 2015 01:58:43 +0000 (21:58 -0400)]
nitdoc: remove `well` around level 2 titles

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

8 years agonitdoc: introduce `DocCommand` concept for nitdoc and nitx
Alexandre Terrasa [Mon, 8 Jun 2015 18:57:33 +0000 (14:57 -0400)]
nitdoc: introduce `DocCommand` concept for nitdoc and nitx

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

8 years agocontrib/friendz/friendz_linux.nit uses linux audio app
BlackMinou [Sun, 21 Jun 2015 17:41:58 +0000 (19:41 +0200)]
contrib/friendz/friendz_linux.nit uses linux audio app

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoAudio : Introduces linux audio
BlackMinou [Sun, 21 Jun 2015 17:41:17 +0000 (19:41 +0200)]
Audio : Introduces linux audio

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agotests: skips some tests for Darwin
Jean Privat [Tue, 23 Jun 2015 18:10:26 +0000 (14:10 -0400)]
tests: skips some tests for Darwin

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

8 years agocontrib/opportunity: add the 'Clear' template
Alexis Laferrière [Tue, 23 Jun 2015 15:38:18 +0000 (11:38 -0400)]
contrib/opportunity: add the 'Clear' template

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

8 years agotests: skip tests by hostname
Jean Privat [Tue, 23 Jun 2015 15:03:25 +0000 (11:03 -0400)]
tests: skip tests by hostname

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

8 years agotests: exec.skip and cc.skip are searched in the sav directories
Jean Privat [Tue, 23 Jun 2015 14:59:14 +0000 (10:59 -0400)]
tests: exec.skip and cc.skip are searched in the sav directories

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

8 years agotests: special sav directories available for uname and system.
Jean Privat [Fri, 19 Jun 2015 01:32:38 +0000 (21:32 -0400)]
tests: special sav directories available for uname and system.

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

8 years agoexamples/xymus.net: use the french Opportunité name in the header
Alexis Laferrière [Tue, 23 Jun 2015 14:51:23 +0000 (10:51 -0400)]
examples/xymus.net: use the french Opportunité name in the header

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

8 years agoexamples/xymus.net: add UQAM/LATECE specific opportunities templates
Alexis Laferrière [Tue, 23 Jun 2015 14:51:01 +0000 (10:51 -0400)]
examples/xymus.net: add UQAM/LATECE specific opportunities templates

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

8 years agocontrib/opportunity: provide french translation for default templates
Alexis Laferrière [Tue, 23 Jun 2015 14:50:21 +0000 (10:50 -0400)]
contrib/opportunity: provide french translation for default templates

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

8 years agocontrib/opportunity: add opportunities templates
Alexis Laferrière [Thu, 26 Mar 2015 15:54:44 +0000 (11:54 -0400)]
contrib/opportunity: add opportunities templates

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

8 years agocontrib/opportunity: improve style of the maybe option checkbox
Alexis Laferrière [Wed, 25 Mar 2015 19:01:26 +0000 (15:01 -0400)]
contrib/opportunity: improve style of the maybe option checkbox

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

8 years agorosetta: ethiopian_multiplication
Renata Carvalho [Thu, 11 Jun 2015 15:05:36 +0000 (11:05 -0400)]
rosetta: ethiopian_multiplication

Close #1464

Signed-off-by: Renata Carvalho <renatawm@gmail.com>

8 years agoRosettaCode: Vignere
Simon Zeni [Tue, 23 Jun 2015 00:11:24 +0000 (20:11 -0400)]
RosettaCode: Vignere

Close #1479

8 years agotests: add pig_the_dice_game
Jean Privat [Tue, 23 Jun 2015 00:04:25 +0000 (20:04 -0400)]
tests: add pig_the_dice_game

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

8 years agorosettacode: pig the dice game
Romain Chanoir [Tue, 23 Jun 2015 00:04:11 +0000 (20:04 -0400)]
rosettacode: pig the dice game

Close #1485

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoMerge: rosetta code: one_dimensional_cellular_automata
Jean Privat [Mon, 22 Jun 2015 23:55:45 +0000 (19:55 -0400)]
Merge: rosetta code: one_dimensional_cellular_automata

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

Pull-Request: #1493

8 years agoMerge: Opportunity i18n & traduction française
Jean Privat [Mon, 22 Jun 2015 23:54:30 +0000 (19:54 -0400)]
Merge: Opportunity i18n & traduction française

This PR brings partial i18n support to Opportunity with a french translation. Most strings from the
 UI are covered but not the error messages. This PR also fixes a few bugs in the i18n phase.

I still have difficulty with the deployment. Launching my web server use `LANGUAGE=fr sudo bin/xymus_net` works, but not when using `daemonize -E LANGUAGE=fr ...`. @R4PaSs do you have an idea for a solution?

http://xymus.net/opportunity/ temporary serves the French version of the site. I may have to revert tot the English version if I need monit and I can't fix the locale issue.

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

8 years agoMerge: Geometry fix
Jean Privat [Mon, 22 Jun 2015 23:53:43 +0000 (19:53 -0400)]
Merge: Geometry fix

There was a big mistake in the boxes API where you would get the bottom of a line when calling for it's top and get the top when you were calling for the bottom xD, so fixed it.
There also was a bug with the usage of the Numerics in the quadtree API.
Also implemented a to_s for quadtree, but not sure if it needs to stay here.

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

8 years agoMerge: Use light FFI instead of the legacy NI in the lib
Jean Privat [Mon, 22 Jun 2015 23:52:49 +0000 (19:52 -0400)]
Merge: Use light FFI instead of the legacy NI in the lib

Update all extern methods previously implemented with the legacy NI to use the light FFI. Also cleans up the `_nit.[ch]` files and a few redundant `is extern` declarations.

There could be a performance hit because we add at least one layer of indirection when invoking the extern method code. And some were previously only macros applied within the generated internal code... However I don't see a difference with the performance of nitc and it can be optimized by the C compiler.

The C structure used in the `exec` module should be replaced by a Nit class. I've added 2 FIXMEs to make it clear. The C structure makes dealing with calls to `pipe` easier but it also makes the rest of the code more complex than needed.

The only use of the legacy NI left is the parser generated by the modified SableCC.

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

8 years agoMerge: Nitunit fails bad code
Jean Privat [Mon, 22 Jun 2015 19:36:14 +0000 (15:36 -0400)]
Merge: Nitunit fails bad code

Documentation that contains only bad code (not tagged) is now reported by nitunit as it should be.

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

8 years agoMerge: Adaptive typing: fix buggy warning messages
Jean Privat [Mon, 22 Jun 2015 19:36:12 +0000 (15:36 -0400)]
Merge: Adaptive typing: fix buggy warning messages

 #1257 relaxed some rules about untyped code in order to allow the compiler to compute a fixed point. So an inconsistent state with untyped code was permitted during the typing.

The problem is that errors messages or warnings could be prematurely displayed during the analysis thus be false because based on non final information.
The solution is to add a post-processing after the fixed point and delay the premature warning so that the information used is computed and reliable.

Moreover, the `useless null test because always null` is now brought back (it was disabled because caused too much unreliable noise)

Close #1257

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

8 years agotests: skip nitpick args1 in niti and nitvm
Alexis Laferrière [Mon, 22 Jun 2015 13:42:06 +0000 (09:42 -0400)]
tests: skip nitpick args1 in niti and nitvm

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

8 years agocontrib/opportunity: gitignore .pot and .mo files
Alexis Laferrière [Sun, 21 Jun 2015 21:06:16 +0000 (17:06 -0400)]
contrib/opportunity: gitignore .pot and .mo files

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

8 years agosrc/i18n_phase: there's no need to unescape
Alexis Laferrière [Sat, 20 Jun 2015 11:44:01 +0000 (07:44 -0400)]
src/i18n_phase: there's no need to unescape

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

8 years agosrc/i18n_phase: breakup 2 complexe lines of code
Alexis Laferrière [Sat, 20 Jun 2015 11:48:51 +0000 (07:48 -0400)]
src/i18n_phase: breakup 2 complexe lines of code

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

8 years agosrc/i18n_phase: use an escape custom to gettext
Alexis Laferrière [Fri, 19 Jun 2015 14:59:30 +0000 (10:59 -0400)]
src/i18n_phase: use an escape custom to gettext

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

8 years agocontrib/opportunity: add rule to build .mo files
Alexis Laferrière [Sat, 20 Jun 2015 03:02:54 +0000 (23:02 -0400)]
contrib/opportunity: add rule to build .mo files

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

8 years agocontrib/opportunity: intro french translation
Alexis Laferrière [Fri, 19 Jun 2015 15:04:10 +0000 (11:04 -0400)]
contrib/opportunity: intro french translation

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

8 years agocontrib/opportunity: hack to circumvent #1530
Alexis Laferrière [Fri, 19 Jun 2015 15:02:49 +0000 (11:02 -0400)]
contrib/opportunity: hack to circumvent #1530

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

8 years agocontrib/opportunity: prepare for i18n by separating the localized strings from the...
Alexis Laferrière [Fri, 19 Jun 2015 15:01:24 +0000 (11:01 -0400)]
contrib/opportunity: prepare for i18n by separating the localized strings from the rest

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

8 years agogeometry/quadtree: fixed use of the numerics
BlackMinou [Sun, 21 Jun 2015 17:32:41 +0000 (19:32 +0200)]
geometry/quadtree: fixed use of the numerics

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agogeometry/boxes: top and bottom in ILine were inversed...
BlackMinou [Sun, 21 Jun 2015 17:35:58 +0000 (19:35 +0200)]
geometry/boxes: top and bottom in ILine were inversed...

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agolib/text: protect the `format` method against inconsistencies
Alexis Laferrière [Fri, 19 Jun 2015 15:00:24 +0000 (11:00 -0400)]
lib/text: protect the `format` method against inconsistencies

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

8 years agosrc/i18n_phase: accepts string literals within a superstring
Alexis Laferrière [Fri, 19 Jun 2015 14:59:53 +0000 (10:59 -0400)]
src/i18n_phase: accepts string literals within a superstring

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

8 years agoMerge: Check for errors in regex within string literals at compilation
Jean Privat [Fri, 19 Jun 2015 19:41:12 +0000 (15:41 -0400)]
Merge: Check for errors in regex within string literals at compilation

This is the first part for #1511.

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

8 years agoMerge: niti-ffi: NativeString is re-a `char*` since #1502
Jean Privat [Fri, 19 Jun 2015 19:41:09 +0000 (15:41 -0400)]
Merge: niti-ffi: NativeString is re-a `char*` since #1502

This removes a warning during the initial make.

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

9 years agoniti-ffi: NativeString is re-a `char*` since #1502
Jean Privat [Fri, 19 Jun 2015 02:06:57 +0000 (22:06 -0400)]
niti-ffi: NativeString is re-a `char*` since #1502

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

9 years agoMerge: Bug fixes in SSA module
Jean Privat [Fri, 19 Jun 2015 01:34:47 +0000 (21:34 -0400)]
Merge: Bug fixes in SSA module

This small PR fixes two bugs in SSA.

First: A property was unecessary specific in the hierarchy.
Second: Bad initialization of two attributes which cause runtime error in new tests.

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

9 years agoMerge: Fix FFI with private extern classes not needing a "C Header" block
Jean Privat [Fri, 19 Jun 2015 01:33:41 +0000 (21:33 -0400)]
Merge: Fix FFI with private extern classes not needing a "C Header" block

According to the [manual of the C FFI for wrappers](http://nitlanguage.org/FFI/wrapping_C_libraries/), a private extern class does not need to import (or declare) its C equivalent type in the "C header" it can be done only in the "C body" (or the default "C" block).

This bug broke this feature. It may have been reintroduced by 16f94e0, or maybe even before. This PR adds a test to prevent future regression.

Bug referenced in #1520.

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

9 years agotests: test regular expression validation phase
Alexis Laferrière [Thu, 18 Jun 2015 19:30:29 +0000 (15:30 -0400)]
tests: test regular expression validation phase

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

9 years agosrc/frontend: add a phase to validate regular expression
Alexis Laferrière [Thu, 18 Jun 2015 14:25:53 +0000 (10:25 -0400)]
src/frontend: add a phase to validate regular expression

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

9 years agossa: Delete an unused variable
Julien Pagès [Thu, 18 Jun 2015 14:03:13 +0000 (16:03 +0200)]
ssa: Delete an unused variable

Signed-off-by: Julien Pagès <julien.projet@gmail.com>

9 years agossa: Bug fixe with a wrong initialization
Julien Pagès [Thu, 18 Jun 2015 13:14:06 +0000 (15:14 +0200)]
ssa: Bug fixe with a wrong initialization

Signed-off-by: Julien Pagès <julien.projet@gmail.com>

9 years agossa: Make a property more general
Julien Pagès [Mon, 15 Jun 2015 14:46:38 +0000 (16:46 +0200)]
ssa: Make a property more general

Signed-off-by: Julien Pagès <julien.projet@gmail.com>

9 years agotests: mark as undefined tests using NativeFile, hacked in niti
Alexis Laferrière [Thu, 18 Jun 2015 12:48:22 +0000 (08:48 -0400)]
tests: mark as undefined tests using NativeFile, hacked in niti

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

9 years agolib/signals: fix missing import and initializer for GCC
Alexis Laferrière [Thu, 18 Jun 2015 12:45:06 +0000 (08:45 -0400)]
lib/signals: fix missing import and initializer for GCC

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

9 years agolib/signals: do no pin references if the FFI feature is not available
Alexis Laferrière [Thu, 18 Jun 2015 12:39:17 +0000 (08:39 -0400)]
lib/signals: do no pin references if the FFI feature is not available

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

9 years agolib/signals: clean up whitespaces and style
Alexis Laferrière [Thu, 18 Jun 2015 12:37:54 +0000 (08:37 -0400)]
lib/signals: clean up whitespaces and style

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

9 years agolib/signals: remove full FFI features from the module blocks
Alexis Laferrière [Thu, 18 Jun 2015 12:37:21 +0000 (08:37 -0400)]
lib/signals: remove full FFI features from the module blocks

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

9 years agotests: intro a test with the different FFI module block
Alexis Laferrière [Tue, 16 Jun 2015 23:50:37 +0000 (19:50 -0400)]
tests: intro a test with the different FFI module block

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

9 years agosrc/ffi: do not declare the impl signature before the custom C code
Alexis Laferrière [Tue, 16 Jun 2015 23:16:50 +0000 (19:16 -0400)]
src/ffi: do not declare the impl signature before the custom C code

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

9 years agoMerge branch 'master' into lib-use-light-ffi
Alexis Laferrière [Thu, 18 Jun 2015 11:28:23 +0000 (07:28 -0400)]
Merge branch 'master' into lib-use-light-ffi

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

9 years agoMerge: Second batch of RosettaCode
Jean Privat [Thu, 18 Jun 2015 03:09:37 +0000 (23:09 -0400)]
Merge: Second batch of RosettaCode

In this one, I rewrote the commits to squash them, clean them and add tests.

Since the commits are rewrote, their sha1 differ so the PR numbers are added in the descriptions of the commits to keep track of the original request.

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

9 years agoMerge: Do not compile dead modules
Jean Privat [Thu, 18 Jun 2015 03:09:33 +0000 (23:09 -0400)]
Merge: Do not compile dead modules

Separate compilation implies that a module is compiled independently of its clients.
This point ensure us that the recompilation of programs is fast since only modified modules need to be recompiled and that modules used by multiples clients need to be compiled only once.

Unfortunately, currently an already compiled module need to still to be fully compiled in C on each compilation (avoiding doing it is a very complex matter). Fortunately, most of the compilation time is spend by the C compiler (especially when #1498) and this time is safely decimated by ccache.

However, a thing that some modules are imported by programs (thus provide declarations, introductions, importations) but are only made of method definitions that will never be executed by the program. Such a module is called a *dead* module and our static analysis RTA can approximate them.
So, now, the generation of C code for such a module is skipped (and its associated C compilation, obviously)

This will benefit mostly small programs that imports standard and other libraries but only use a small portion of them. Eg: programs in `tests/` or in `examples/rossetacode`.

For numbers, lets try with `time ./tests.sh ../examples/rosettacode/*.nit` to test the 32 (currently) programs.

* before: 30s
* after: 21s

I hope that CI servers will like what we, human masters, do for them!

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

9 years agotests: other update related to adaptive typing messages
Jean Privat [Thu, 18 Jun 2015 02:26:12 +0000 (22:26 -0400)]
tests: other update related to adaptive typing messages

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

9 years agotests: new tests base_adaptive_loop_null2.nit base_adaptive_loop_isa.nit
Jean Privat [Thu, 18 Jun 2015 02:12:29 +0000 (22:12 -0400)]
tests: new tests base_adaptive_loop_null2.nit base_adaptive_loop_isa.nit

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

9 years agotyping: warn about useless null when the target is always `null`
Jean Privat [Thu, 18 Jun 2015 01:51:44 +0000 (21:51 -0400)]
typing: warn about useless null when the target is always `null`

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

9 years agotyping: warnings related to adaptive typing are moved to the post_typing
Jean Privat [Thu, 18 Jun 2015 01:49:56 +0000 (21:49 -0400)]
typing: warnings related to adaptive typing are moved to the post_typing

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

9 years agolib/markdown: fix markdown used in documentation (how ironic)
Jean Privat [Thu, 18 Jun 2015 02:51:02 +0000 (22:51 -0400)]
lib/markdown: fix markdown used in documentation (how ironic)

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

9 years agotyping: new PostTypingVisitor that is run after the visit
Jean Privat [Thu, 18 Jun 2015 01:49:38 +0000 (21:49 -0400)]
typing: new PostTypingVisitor that is run after the visit

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

9 years agotyping: factorize AEqExpr and ANeExpr into AEqFormExpr
Jean Privat [Thu, 18 Jun 2015 01:46:19 +0000 (21:46 -0400)]
typing: factorize AEqExpr and ANeExpr into AEqFormExpr

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

9 years agoast: new class AEqFormExpr to factorize AEqExpr and ANeExpr
Jean Privat [Thu, 18 Jun 2015 01:44:22 +0000 (21:44 -0400)]
ast: new class AEqFormExpr to factorize AEqExpr and ANeExpr

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