nit.git
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: Decimal literals with underscores
Jean Privat [Wed, 29 Jul 2015 02:23:17 +0000 (22:23 -0400)]
Merge: Decimal literals with underscores

As requested by @xymus in PR #1588, the support of underscores in decimal literals is added to the parser in this PR

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

8 years agoMerge: Cached ropes
Jean Privat [Wed, 29 Jul 2015 02:23:12 +0000 (22:23 -0400)]
Merge: Cached ropes

Added a wee bit of optimization on Ropes, indexed accesses are properly cached and file manipulations (especially `read_all`) now yields a good balanced Rope, which should reduce the degenerative cases of random indexed access whilst preserving most of the performance in local access.

This has a positive (though small) impact on a the compiler :

* Before: `I   refs:      14,286,788,827`
* After: `I   refs:      14,197,458,800` (-0.63%)

What is seen in Valgrind is unfortunately unchanged in user-time (nitc-sg compiling nitg-sg) :

* Before: `user 0m5.360s`
* After: `user 0m5.367s`

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

8 years agotests: Update base_test_bases to check support of undercore
Lucas Bajolet [Tue, 28 Jul 2015 15:32:16 +0000 (11:32 -0400)]
tests: Update base_test_bases to check support of undercore

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

8 years agosrc: Update literal to properly support underscores in decimal literals
Lucas Bajolet [Tue, 28 Jul 2015 15:32:03 +0000 (11:32 -0400)]
src: Update literal to properly support underscores in decimal literals

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

8 years agoParser regeneration
Lucas Bajolet [Tue, 28 Jul 2015 15:31:37 +0000 (11:31 -0400)]
Parser regeneration

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

8 years agoparser: Update parser for underscores support in decimal literals
Lucas Bajolet [Tue, 28 Jul 2015 15:31:27 +0000 (11:31 -0400)]
parser: Update parser for underscores support in decimal literals

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

8 years agotests: Fix for cached_ropes, lines had changed in Nitpick
Lucas Bajolet [Tue, 28 Jul 2015 15:05:31 +0000 (11:05 -0400)]
tests: Fix for cached_ropes, lines had changed in Nitpick

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

8 years agolib/standard: Read all now builds ropes
Lucas Bajolet [Mon, 27 Jul 2015 18:20:47 +0000 (14:20 -0400)]
lib/standard: Read all now builds ropes

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

8 years agolib/standard/ropes: Added balancing method to Concat
Lucas Bajolet [Tue, 21 Jul 2015 15:23:26 +0000 (11:23 -0400)]
lib/standard/ropes: Added balancing method to Concat

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

8 years agolib/standard/ropes: Added cache mechanism on indexed access for Concat
Lucas Bajolet [Tue, 21 Jul 2015 15:12:10 +0000 (11:12 -0400)]
lib/standard/ropes: Added cache mechanism on indexed access for Concat

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

8 years agoMerge: Fix Chainz of Friendz buttons on Android
Jean Privat [Mon, 27 Jul 2015 01:14:18 +0000 (21:14 -0400)]
Merge: Fix Chainz of Friendz buttons on Android

Intro `AndroidPointerEvent::is_move` and tweak Chainz of Friendz so it doesn't consider the release event as a move event.

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

8 years agocontrib/friendz: fix input using is_move
Alexis Laferrière [Sun, 26 Jul 2015 12:28:23 +0000 (08:28 -0400)]
contrib/friendz: fix input using is_move

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

8 years agolib/android: intro `AndroidPointerEvent::is_move`
Alexis Laferrière [Sun, 26 Jul 2015 12:28:05 +0000 (08:28 -0400)]
lib/android: intro `AndroidPointerEvent::is_move`

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

8 years agolib/android: remove a few warnings
Alexis Laferrière [Sun, 26 Jul 2015 12:27:09 +0000 (08:27 -0400)]
lib/android: remove a few warnings

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

8 years agoMerge: jwrapper generates full APIs, with contructors, getters and setters
Jean Privat [Sat, 25 Jul 2015 23:55:12 +0000 (19:55 -0400)]
Merge: jwrapper generates full APIs, with contructors, getters and setters

This PR is the second part to #1578, it updates the structure of jwrapper, adds a lot of features and creates usable APIs.

Main changes:
* Rewrite of the AST visitor, type conversion and entity naming.
* Generate constructors.
* Generate getter/setters to attributes.
* Add the -p option to choose the prefix of extern class names, use the namespace by default.
* Add the -i option to scan for existing wrappers in any directory or file.
* Add the -r option to filter the target classes from a Jar archive using a regular expression.
* Add more simple tests with javap outputs.
* Add a complete (and working) example of using a custom Java collection from Nit.
* Add an example of generating an API for Android using jwrapper. This API passes nitpick, but it has not been tested as it needs to be integrated in our Android framework.

What's to do next:
* Support for primitive arrays. (This is the main reason why ~10% of the functions are disabled)
* Add static functions as top-level methods.
* Generate class hierarchy.
* Use nitls with the -i option and to add importations to the generated module.
* Fix generic params usage.

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

8 years agoMerge: Improve documentation of kernel
Jean Privat [Sat, 25 Jul 2015 01:17:47 +0000 (21:17 -0400)]
Merge: Improve documentation of kernel

Improve the documentation of Object and Sys.
Also experiments with the new nitdoc features #1447

Some issues I discovered while writing and using the doc while thinking about nitdoc.

* micro-picking classes and methods to include in the README is not fun
* headings (`###`) in the markdown might not have the right level in the generated HTML
* having reified property groups (#1413) should help to organize thing and have automatic feedback on it trough the doc
* maybe the `[[list:]]` directive should no list entities not already included by `[[doc:]]` (or a new `[[list_other:]]` directive?)
* having a way to generate a full linear and strucuted documentation in a single page could simplify the job of the writer when checking the doc.

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

8 years agotests: update sav because line changes in kernel
Jean Privat [Fri, 24 Jul 2015 20:50:46 +0000 (16:50 -0400)]
tests: update sav because line changes in kernel

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

8 years agolib: add a README for standard
Jean Privat [Thu, 23 Jul 2015 03:06:26 +0000 (23:06 -0400)]
lib: add a README for standard

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

8 years agolib: improve documentation of Object and Sys in kernel
Jean Privat [Thu, 23 Jul 2015 03:06:07 +0000 (23:06 -0400)]
lib: improve documentation of Object and Sys in kernel

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

8 years agocontrib/jwrapper: fix commenting out unknown types on `-u comment` only
Alexis Laferrière [Fri, 24 Jul 2015 13:16:47 +0000 (09:16 -0400)]
contrib/jwrapper: fix commenting out unknown types on `-u comment` only

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

8 years agocontrib/jwrapper: find extern classes with underscore in their names
Alexis Laferrière [Fri, 24 Jul 2015 13:10:03 +0000 (09:10 -0400)]
contrib/jwrapper: find extern classes with underscore in their names

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

8 years agocontrib/jwrapper: check-libs depends on each other and nitpick the result
Alexis Laferrière [Thu, 23 Jul 2015 13:36:07 +0000 (09:36 -0400)]
contrib/jwrapper: check-libs depends on each other and nitpick the result

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

8 years agocontrib/jwrapper: add an example that generates an API for Android
Alexis Laferrière [Thu, 23 Jul 2015 21:59:53 +0000 (17:59 -0400)]
contrib/jwrapper: add an example that generates an API for Android

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

8 years agocontrib/jwrapper: intro a practical example use of jwrapper
Alexis Laferrière [Thu, 23 Jul 2015 16:52:52 +0000 (12:52 -0400)]
contrib/jwrapper: intro a practical example use of jwrapper

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

8 years agocontrib/jwrapper: make casting base objects (Integer, Long, etc.) optional
Alexis Laferrière [Fri, 24 Jul 2015 13:07:29 +0000 (09:07 -0400)]
contrib/jwrapper: make casting base objects (Integer, Long, etc.) optional

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

8 years agocontrib/jwrapper: do not remove get_ or replace set_
Alexis Laferrière [Thu, 23 Jul 2015 21:55:40 +0000 (17:55 -0400)]
contrib/jwrapper: do not remove get_ or replace set_

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

8 years agocontrib/jwrapper: comment out all primitive arrays
Alexis Laferrière [Thu, 23 Jul 2015 21:52:31 +0000 (17:52 -0400)]
contrib/jwrapper: comment out all primitive arrays

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

8 years agocontrib/jwrapper: add an option to search for existing wrappers in custom libs
Alexis Laferrière [Thu, 23 Jul 2015 21:51:15 +0000 (17:51 -0400)]
contrib/jwrapper: add an option to search for existing wrappers in custom libs

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

8 years agocontrib/jwrapper: add some top-level methods to the reserved keywords
Alexis Laferrière [Thu, 23 Jul 2015 21:50:10 +0000 (17:50 -0400)]
contrib/jwrapper: add some top-level methods to the reserved keywords

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

8 years agocontrib/jwrapper: improve `JavaType::==`
Alexis Laferrière [Thu, 23 Jul 2015 15:10:42 +0000 (11:10 -0400)]
contrib/jwrapper: improve `JavaType::==`

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

8 years agocontrib/jwrapper: remove old naming escape on methods
Alexis Laferrière [Thu, 23 Jul 2015 14:58:56 +0000 (10:58 -0400)]
contrib/jwrapper: remove old naming escape on methods

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

8 years agocontrib/jwrapper: filter classes from Jar archives with a regex
Alexis Laferrière [Thu, 23 Jul 2015 14:04:26 +0000 (10:04 -0400)]
contrib/jwrapper: filter classes from Jar archives with a regex

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

8 years agocontrib/jwrapper: use the new type conversion system in code gen
Alexis Laferrière [Thu, 23 Jul 2015 13:35:09 +0000 (09:35 -0400)]
contrib/jwrapper: use the new type conversion system in code gen

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

8 years agocontrib/jwrapper: remove unused code
Alexis Laferrière [Thu, 23 Jul 2015 13:34:08 +0000 (09:34 -0400)]
contrib/jwrapper: remove unused code

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

8 years agocontrib/jwrapper: revamp conversion from Java to Nit types
Alexis Laferrière [Thu, 23 Jul 2015 13:33:29 +0000 (09:33 -0400)]
contrib/jwrapper: revamp conversion from Java to Nit types

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

8 years agocontrib/jwrapper: revamp and merge extern_name and extern_class_name
Alexis Laferrière [Thu, 23 Jul 2015 13:31:57 +0000 (09:31 -0400)]
contrib/jwrapper: revamp and merge extern_name and extern_class_name

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

8 years agocontrib/jwrapper: intro an option to choose the extern class name prefix
Alexis Laferrière [Thu, 23 Jul 2015 13:22:35 +0000 (09:22 -0400)]
contrib/jwrapper: intro an option to choose the extern class name prefix

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

8 years agocontrib/jwrapper: update signatures of the gen_ methods
Alexis Laferrière [Thu, 23 Jul 2015 13:02:03 +0000 (09:02 -0400)]
contrib/jwrapper: update signatures of the gen_ methods

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

8 years agocontrib/jwrapper: generate constructors
Alexis Laferrière [Thu, 23 Jul 2015 13:27:12 +0000 (09:27 -0400)]
contrib/jwrapper: generate constructors

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

8 years agocontrib/jwrapper: generate getter and setter to access fields
Alexis Laferrière [Tue, 21 Jul 2015 18:53:54 +0000 (14:53 -0400)]
contrib/jwrapper: generate getter and setter to access fields

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

8 years agocontrib/jwrapper: intro a service to avoid property name conflicts
Alexis Laferrière [Thu, 23 Jul 2015 13:11:22 +0000 (09:11 -0400)]
contrib/jwrapper: intro a service to avoid property name conflicts

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

8 years agocontrib/jwrapper: revamp the search with grep and cache the results
Alexis Laferrière [Wed, 22 Jul 2015 18:37:08 +0000 (14:37 -0400)]
contrib/jwrapper: revamp the search with grep and cache the results

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

8 years agocontrib/jwrapper: `JavaModel::classes` sort keys by string
Alexis Laferrière [Wed, 22 Jul 2015 18:44:07 +0000 (14:44 -0400)]
contrib/jwrapper: `JavaModel::classes` sort keys by string

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

8 years agocontrib/jwrapper: add 4 more tests from a javap output
Alexis Laferrière [Wed, 22 Jul 2015 14:01:04 +0000 (10:01 -0400)]
contrib/jwrapper: add 4 more tests from a javap output

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

8 years agocontrib/jwrapper: add missing keywords to mangle
Alexis Laferrière [Wed, 22 Jul 2015 13:59:07 +0000 (09:59 -0400)]
contrib/jwrapper: add missing keywords to mangle

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

8 years agocontrib/jwrapper: big rewrite of the AST visitor
Alexis Laferrière [Wed, 22 Jul 2015 13:50:20 +0000 (09:50 -0400)]
contrib/jwrapper: big rewrite of the AST visitor

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

8 years agocontrib/jwrapper: only the `java` module must always be imported
Alexis Laferrière [Tue, 21 Jul 2015 19:08:49 +0000 (15:08 -0400)]
contrib/jwrapper: only the `java` module must always be imported

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

8 years agocontrib/jwrapper: do not try to generate generic extern classes
Alexis Laferrière [Tue, 21 Jul 2015 18:01:31 +0000 (14:01 -0400)]
contrib/jwrapper: do not try to generate generic extern classes

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

8 years agocontrib/jwrapper: update constructor and use optional attributes in NitType
Alexis Laferrière [Tue, 21 Jul 2015 17:56:55 +0000 (13:56 -0400)]
contrib/jwrapper: update constructor and use optional attributes in NitType

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

8 years agocontrib/jwrapper: remove NitType::arg_id it was unused, only set
Alexis Laferrière [Tue, 21 Jul 2015 17:50:15 +0000 (13:50 -0400)]
contrib/jwrapper: remove NitType::arg_id it was unused, only set

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

8 years agocontrib/jwrapper: use JavaTypeConverter as a singleton
Alexis Laferrière [Tue, 21 Jul 2015 17:26:35 +0000 (13:26 -0400)]
contrib/jwrapper: use JavaTypeConverter as a singleton

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

8 years agoffi/java: pointers are stored as `long` so they grow with the architecture
Alexis Laferrière [Thu, 23 Jul 2015 17:54:20 +0000 (13:54 -0400)]
ffi/java: pointers are stored as `long` so they grow with the architecture

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

8 years agolib/java: fix expected type with JNI's `GetStringUTFChars`
Alexis Laferrière [Thu, 23 Jul 2015 17:53:51 +0000 (13:53 -0400)]
lib/java: fix expected type with JNI's `GetStringUTFChars`

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

8 years agoMerge: UTF-8 Strings
Jean Privat [Thu, 23 Jul 2015 17:33:29 +0000 (13:33 -0400)]
Merge: UTF-8 Strings

In regard to #1262, and after many rewritings, here's a fully-functional prototype for UTF-8 compliant Strings !

Many things have changed and now, operations on String will need to be considered differently to avoid bad surprises, namely:

- FlatBuffers are slow as hell when getting chars or modifying in-place (and an in-place modification can degenerate if a single-byte char is modified by a multibyte char)
- Length is now potentially expensive (especially within FlatBuffer where it is not cached)
- Indexed access is now O(n), though it is cached for local accesses (except in FlatBuffer)

Performances, for the user time of `nitc src/nitc.nit -o bin/nitc`, has gone from 4.55s to 4.80s, so +5.5%; we have seen worse.

So a little slowdown, but definitely acceptable when introducing UTF-8 in Strings.

Pull-Request: #1277
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: NSieve optimization
Jean Privat [Thu, 23 Jul 2015 17:33:14 +0000 (13:33 -0400)]
Merge: NSieve optimization

The `shootout_nsieve` benchmark has been present in tests for a long time (longer than I can remember actually).

Up until now, its performances have been constant and quite good, since the work was done in less than 15ms.

However, due to its use of `FlatBuffer` and indexed access, it degenerates when using UTF-8 (see #1277) and the run time of `shootout_nsieve` scales from `0m0.011s` to `1m59.870s`.

This PR fixes that.

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

8 years agoMerge: Fix lib/realtime on osx
Jean Privat [Thu, 23 Jul 2015 17:32:50 +0000 (13:32 -0400)]
Merge: Fix lib/realtime on osx

A lot of googling to solve two related issues on Mac OS X

* `clock_gettime` and cie is not provided, and one should use the more complex clock_get_time (and cie)
* the POSIX `-lrt` is refused by the linker

close #868

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

8 years agoMerge: Improve initial make
Jean Privat [Thu, 23 Jul 2015 17:32:37 +0000 (13:32 -0400)]
Merge: Improve initial make

Small improvement to make the initial make better.
For the final user perspective, an useless error message is removed and the whole process should be slightly faster.

Before:

* real time with cleared ccache: 4m46s
* user time with cleared ccache: 13m23s
* real time with full ccache: 42.5s
* user time with full ccache: 41.8s

After:

* real time with cleared ccache: 4m30s (-5.6%)
* user time with cleared ccache: 13m23s (-4.6%)
* real time with full ccache: 42.5s (-27.8%)
* user time with full ccache: 41.8s (-24.63)

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

8 years agotests: Updated for correct semantics, added new tests for Unicode
Lucas Bajolet [Thu, 23 Jul 2015 15:14:36 +0000 (11:14 -0400)]
tests: Updated for correct semantics, added new tests for Unicode

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

8 years agosrc: Compiler, interpreter and parser updates for UTF-8
Lucas Bajolet [Fri, 10 Jul 2015 20:15:52 +0000 (16:15 -0400)]
src: Compiler, interpreter and parser updates for UTF-8

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

8 years agolib/standard: Update libs for the support of UTF-8
Lucas Bajolet [Tue, 21 Jul 2015 17:46:08 +0000 (13:46 -0400)]
lib/standard: Update libs for the support of UTF-8

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

8 years agolib/standard: Added services on NativeString and Char for the support of UTF-8
Lucas Bajolet [Fri, 10 Jul 2015 20:15:03 +0000 (16:15 -0400)]
lib/standard: Added services on NativeString and Char for the support of UTF-8

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

8 years agolib/realtime: add a compatibility layer for OSX
Jean Privat [Thu, 23 Jul 2015 14:58:47 +0000 (10:58 -0400)]
lib/realtime: add a compatibility layer for OSX

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

8 years agocompiler: filter out -lrt flaf for OXS
Jean Privat [Thu, 23 Jul 2015 14:58:08 +0000 (10:58 -0400)]
compiler: filter out -lrt flaf for OXS

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

8 years agoMakefile: compile nitc_0 with --semi-global as it make the whole `make` faster
Jean Privat [Thu, 23 Jul 2015 13:56:48 +0000 (09:56 -0400)]
Makefile: compile nitc_0 with --semi-global as it make the whole `make` faster

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

8 years agoMakefile: do not rely in multiple targets as it may cause multiple invocation of...
Jean Privat [Thu, 23 Jul 2015 13:56:15 +0000 (09:56 -0400)]
Makefile: do not rely in multiple targets as it may cause multiple invocation of the recipe

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

8 years agoMakefile: remove now useless `rm .nitcompile`
Jean Privat [Thu, 23 Jul 2015 13:55:20 +0000 (09:55 -0400)]
Makefile: remove now useless `rm .nitcompile`

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

8 years agotests: Shootout_nsieve now uses byte arrays instead of Buffers
Lucas Bajolet [Wed, 22 Jul 2015 18:16:23 +0000 (14:16 -0400)]
tests: Shootout_nsieve now uses byte arrays instead of Buffers

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

8 years agolib/c: CByteArray now uses Byte instead of Int
Lucas Bajolet [Wed, 22 Jul 2015 17:41:01 +0000 (13:41 -0400)]
lib/c: CByteArray now uses Byte instead of Int

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

8 years agoMerge: lib/std: add Path::last_error to aggregate errors on path services.
Jean Privat [Wed, 22 Jul 2015 17:37:52 +0000 (13:37 -0400)]
Merge: lib/std: add Path::last_error to aggregate errors on path services.

It it not complete but still a start

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

8 years agoMerge: Fix nitpick return value
Jean Privat [Wed, 22 Jul 2015 17:37:48 +0000 (13:37 -0400)]
Merge: Fix nitpick return value

Make that nitpick returns 1 if some errors where detected.
This is more POLA and will helps callers to spot if there was errors in nit files given in arguments.

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

8 years agoMerge: Conditional importation
Jean Privat [Wed, 22 Jul 2015 14:21:05 +0000 (10:21 -0400)]
Merge: Conditional importation

First quick and dirty implementation for #1579.
Since the loader is due to a full rewrite (cf #1250), some part were implemented as simple as possible.

It is only a technology preview. A lot of thing are missing including the following:

* do not error if the modules in the rules are not present (eg optional modules not installed). Not an issue currently since all the modules are present in the repository.
* show warnings for useless condition to help the programmer
* implement some visibility rules. `public` is assumed even if it makes no sense and cause issues
* understand qualified modules in the conditions

The last issue might be the more limiting currently as only the conditional module understand qualified names. the potential qualified names in the arguments are accepted but just ignored.
Basically `toto` is ignored in `import foo::bar is conditional(toto::tata)`.

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

8 years agoMerge: Nitj: A compiler to Java code.
Jean Privat [Wed, 22 Jul 2015 14:21:00 +0000 (10:21 -0400)]
Merge: Nitj: A compiler to Java code.

Introduce a new compiler `nitj` that takes nit code and produce Java code.

Passes ~700/950 tests from the base*.nit test suite.

Since the commit serie is rather long, I suggest to read it comit by commit.

Some features still missing (maybe later):
* generics
* arrays
* varargs
* strings

Note: There is no concrete motivation beyond this engine. Did it for the lulz.

Pull-Request: #1577
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agotests: test return value of nitpick
Jean Privat [Wed, 22 Jul 2015 14:19:11 +0000 (10:19 -0400)]
tests: test return value of nitpick

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

8 years agonitpick: return 1 if errors occurred
Jean Privat [Wed, 22 Jul 2015 14:18:40 +0000 (10:18 -0400)]
nitpick: return 1 if errors occurred

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

8 years agotests: update sav/ for new error messages in file access
Jean Privat [Wed, 22 Jul 2015 12:35:10 +0000 (08:35 -0400)]
tests: update sav/ for new error messages in file access

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

8 years agotests: add test_path
Jean Privat [Tue, 21 Jul 2015 13:20:23 +0000 (09:20 -0400)]
tests: add test_path

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

8 years agolib/std: add some cached services on Path
Jean Privat [Tue, 21 Jul 2015 13:11:48 +0000 (09:11 -0400)]
lib/std: add some cached services on Path

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

8 years agonitj: improve Ant cache by not rewritting unchanged file
Alexandre Terrasa [Thu, 16 Jul 2015 21:54:48 +0000 (17:54 -0400)]
nitj: improve Ant cache by not rewritting unchanged file

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

8 years agonitj: faster recompilation with Ant
Alexandre Terrasa [Thu, 16 Jul 2015 21:52:53 +0000 (17:52 -0400)]
nitj: faster recompilation with Ant

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

8 years agonitj: implement ACastExprs
Alexandre Terrasa [Mon, 13 Jul 2015 21:04:21 +0000 (17:04 -0400)]
nitj: implement ACastExprs

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

8 years agonitj: avoid dead code execution
Alexandre Terrasa [Mon, 13 Jul 2015 17:36:53 +0000 (13:36 -0400)]
nitj: avoid dead code execution

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

8 years agonitj: implement bool exprs
Alexandre Terrasa [Fri, 10 Jul 2015 18:19:32 +0000 (14:19 -0400)]
nitj: implement bool exprs

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

8 years agonitj: factorize frame initialization for method, attribut and init compilation
Alexandre Terrasa [Fri, 10 Jul 2015 18:55:16 +0000 (14:55 -0400)]
nitj: factorize frame initialization for method, attribut and init compilation

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

8 years agonitj: implement non-generic type tests
Alexandre Terrasa [Fri, 10 Jul 2015 18:18:15 +0000 (14:18 -0400)]
nitj: implement non-generic type tests

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

8 years agonitj: implement ADoExpr, AWhileExpr, ALoopExpr
Alexandre Terrasa [Fri, 10 Jul 2015 05:32:01 +0000 (01:32 -0400)]
nitj: implement ADoExpr, AWhileExpr, ALoopExpr

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

8 years agonitj: implement ANotExpr
Alexandre Terrasa [Fri, 10 Jul 2015 06:02:43 +0000 (02:02 -0400)]
nitj: implement ANotExpr

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

8 years agonitj: implement AIFExpr
Alexandre Terrasa [Fri, 10 Jul 2015 06:02:17 +0000 (02:02 -0400)]
nitj: implement AIFExpr

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

8 years agonitj: implement AParExpr
Alexandre Terrasa [Fri, 10 Jul 2015 03:00:55 +0000 (23:00 -0400)]
nitj: implement AParExpr

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

8 years agonitj: implement super calls
Alexandre Terrasa [Fri, 10 Jul 2015 06:05:31 +0000 (02:05 -0400)]
nitj: implement super calls

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

8 years agonitj: implement attributes expressions
Alexandre Terrasa [Fri, 10 Jul 2015 06:04:07 +0000 (02:04 -0400)]
nitj: implement attributes expressions

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

8 years agonitj: implement main call
Alexandre Terrasa [Fri, 10 Jul 2015 00:02:05 +0000 (20:02 -0400)]
nitj: implement main call

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

8 years agonitj: compile java main function stub
Alexandre Terrasa [Tue, 30 Jun 2015 19:08:56 +0000 (15:08 -0400)]
nitj: compile java main function stub

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

8 years agonitj: implement instances initialization
Alexandre Terrasa [Fri, 10 Jul 2015 00:01:50 +0000 (20:01 -0400)]
nitj: implement instances initialization

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

8 years agonitj: compile attributes accesses
Alexandre Terrasa [Fri, 10 Jul 2015 00:05:06 +0000 (20:05 -0400)]
nitj: compile attributes accesses

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

8 years agonitj: compile intern methods bodies
Alexandre Terrasa [Thu, 9 Jul 2015 23:58:53 +0000 (19:58 -0400)]
nitj: compile intern methods bodies

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

8 years agotyping: also type signature for intern methods
Alexandre Terrasa [Tue, 14 Jul 2015 05:28:14 +0000 (01:28 -0400)]
typing: also type signature for intern methods

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

8 years agonitj: compile concrete methods bodies
Alexandre Terrasa [Thu, 9 Jul 2015 23:58:12 +0000 (19:58 -0400)]
nitj: compile concrete methods bodies

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

8 years agonitj: implement instance initialization and ANewExprs
Alexandre Terrasa [Mon, 6 Jul 2015 16:49:20 +0000 (12:49 -0400)]
nitj: implement instance initialization and ANewExprs

Attributes are not handled in this commit.

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

8 years agonitj: avoid calls to abstract methods
Alexandre Terrasa [Mon, 13 Jul 2015 21:08:52 +0000 (17:08 -0400)]
nitj: avoid calls to abstract methods

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