nit.git
9 years agotests: add base_gen_final_bound.nit
Jean Privat [Thu, 24 Jul 2014 18:10:18 +0000 (14:10 -0400)]
tests: add base_gen_final_bound.nit

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

9 years agomodelize_classes: warn on parameter types bounded on final classes
Jean Privat [Thu, 24 Jul 2014 18:07:46 +0000 (14:07 -0400)]
modelize_classes: warn on parameter types bounded on final classes

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

9 years agomodel: MParameterType.resolve_for handle the case of primitive bounds
Jean Privat [Thu, 24 Jul 2014 18:06:15 +0000 (14:06 -0400)]
model: MParameterType.resolve_for handle the case of primitive bounds

~~~
class G[E: Int]
   # Since Int cannot have sublclasses, E == Int
end
~~~

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

9 years agotyping: generalize warning on useless type tests.
Jean Privat [Thu, 24 Jul 2014 18:03:54 +0000 (14:03 -0400)]
typing: generalize warning on useless type tests.

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

9 years agotests: fix a typing error in some tests
Jean Privat [Thu, 24 Jul 2014 17:54:42 +0000 (13:54 -0400)]
tests: fix a typing error in some tests

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

9 years agotests: add base_virtual_type_fixed.nit
Jean Privat [Wed, 23 Jul 2014 02:20:08 +0000 (22:20 -0400)]
tests: add base_virtual_type_fixed.nit

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

9 years agomodel: introduce `MVirtualType::is_fixed` used indirectly by is_subtype
Jean Privat [Wed, 23 Jul 2014 02:17:48 +0000 (22:17 -0400)]
model: introduce `MVirtualType::is_fixed` used indirectly by is_subtype

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

9 years agotests: extends base_virtual_type_redef for `is fixed`
Jean Privat [Tue, 22 Jul 2014 19:08:42 +0000 (15:08 -0400)]
tests: extends base_virtual_type_redef for `is fixed`

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

9 years agomodel: add annotation `fixed` on virtual types
Jean Privat [Tue, 22 Jul 2014 19:07:56 +0000 (15:07 -0400)]
model: add annotation `fixed` on virtual types

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

9 years agotests: update for VT check
Jean Privat [Tue, 22 Jul 2014 19:05:35 +0000 (15:05 -0400)]
tests: update for VT check

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

9 years agomodelize_properties: check redef types in ATypePropdef
Jean Privat [Tue, 22 Jul 2014 19:02:43 +0000 (15:02 -0400)]
modelize_properties: check redef types in ATypePropdef

Because some programs (mnit) rely on unsound virtual type refinement,
some errors are displayed as warnings.

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

9 years agoMerge: add the annotation `readonly` on attributes
Jean Privat [Tue, 22 Jul 2014 03:17:07 +0000 (23:17 -0400)]
Merge: add the annotation `readonly` on attributes

`readonly` just generate no setter. So the value must be set trough the initial value.

Basically it is like the Scala `val` keyword.
Note that unlike the Java `final` modifier, the value cannot be set in a constructor (use a private setter instead if you need a restriction on the setter visibility)

~~~.rb
class Toto
   var a = new Array[Int] is readonly
end
var t = new Toto
t.a.add 5 # OK
t.a = new Array[Int] # Error: no `a=` in Toto
~~~

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

9 years agoMerge: understand writable as an annotation
Jean Privat [Tue, 22 Jul 2014 03:17:01 +0000 (23:17 -0400)]
Merge: understand writable as an annotation

~~~.rb
class Toto
   var x: Int writable = 5 # before
   var y: Int = 5 is writable # after
~~~

This should become the new way, so while an active migration is not needed yet, once this PR is merger, new code should use the new notation.

Bonus: writable accepts an optional agrument that is the name of the writer.
This allows the reserve the name `foo=` for high-level setters.

Eg.
~~~.rb
class Toto
   var x: Int is private writable(set_x) # generates `set_x` instead of `x=`
   fun x=(v: Int) do # `x=` is feee, so I can use it for a distinct method
      assert x >= 0
      set_x(v) # I use the generated `set_x` as a private internal setter
   end
end
~~~

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

9 years agoMerge: add attribute annotation `noinit` to skip the attribute in inits
Jean Privat [Tue, 22 Jul 2014 03:16:56 +0000 (23:16 -0400)]
Merge: add attribute annotation `noinit` to skip the attribute in inits

~~~.rb
class Toto
   var tata: Int is noinit
   var tutu: String
end
var t = new Toto("hello") # only tutu in the constructor
~~~

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

9 years agoMerge: Stop making docs by default
Jean Privat [Tue, 22 Jul 2014 03:16:49 +0000 (23:16 -0400)]
Merge: Stop making docs by default

I am not sure people use the generated doc (I often ^C); for those that use it is, just `make docs`

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

9 years agotests: add base_attr_readonly
Jean Privat [Mon, 21 Jul 2014 18:57:49 +0000 (14:57 -0400)]
tests: add base_attr_readonly

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

9 years agoMerge: proposal for model: Generalize access to `model` form `MEntitiy`.
Jean Privat [Tue, 22 Jul 2014 02:57:05 +0000 (22:57 -0400)]
Merge: proposal for model: Generalize access to `model` form `MEntitiy`.

Since, MEntity are model things, let the user access to the model from them.

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

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

9 years agoMerge: jwrapper: An extern class `in "Java"` generator
Jean Privat [Tue, 22 Jul 2014 02:57:00 +0000 (22:57 -0400)]
Merge: jwrapper: An extern class `in "Java"` generator

Consider as Work In Progress. This is an overview of what has been done so far on the java wrapper generator. Most of the features are implemented, but there's still a lot of work to do. In its actual form, the tool takes javap output stored in a file and wraps all methods and attributes (not really useful, but implemented) to generate a nit extern class in a .nit file. Up to one collection parameter and one collection return type are copied. Methods containing non-convertible types are auto-commented.

Features to come :
* Auto-generation of extern class for non-convertible types
* User interface with options
* Static overload support

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

9 years agoMerge: friendz, a new game for contrib
Jean Privat [Tue, 22 Jul 2014 02:56:53 +0000 (22:56 -0400)]
Merge: friendz, a new game for contrib

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

9 years agomodelize_property: add readonly annotation on attributes
Jean Privat [Mon, 21 Jul 2014 18:55:55 +0000 (14:55 -0400)]
modelize_property: add readonly annotation on attributes

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

9 years agocontrib/jwrapper: Added static overload support
Frédéric Vachon [Mon, 21 Jul 2014 20:13:34 +0000 (16:13 -0400)]
contrib/jwrapper: Added static overload support

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

9 years agodoc: do not make the stdlib doc by default
Jean Privat [Mon, 21 Jul 2014 18:44:29 +0000 (14:44 -0400)]
doc: do not make the stdlib doc by default

9 years agodoc: remove doc/Makefile
Jean Privat [Mon, 21 Jul 2014 18:43:56 +0000 (14:43 -0400)]
doc: remove doc/Makefile

Since there is no more doc to generate

9 years agomodel: Generalize access to `model` form `MEntitiy`.
Alexandre Terrasa [Mon, 21 Jul 2014 18:29:31 +0000 (14:29 -0400)]
model: Generalize access to `model` form `MEntitiy`.

Since, MEntity are model things, let the user access to the model from them.

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

9 years agomodel: makes MParameter an MEntity
Alexandre Terrasa [Sun, 20 Jul 2014 16:37:32 +0000 (12:37 -0400)]
model: makes MParameter an MEntity

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

9 years agotests: add base_attr_named_setters
Jean Privat [Mon, 21 Jul 2014 16:09:54 +0000 (12:09 -0400)]
tests: add base_attr_named_setters

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

9 years agoannotation: add arg_as_id
Jean Privat [Mon, 21 Jul 2014 15:55:54 +0000 (11:55 -0400)]
annotation: add arg_as_id

I do not know why is was forgot

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

9 years agomodelize_property: accepts alternative name for setters
Jean Privat [Mon, 21 Jul 2014 15:56:54 +0000 (11:56 -0400)]
modelize_property: accepts alternative name for setters

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

9 years agotest: convert writable to annotations
Jean Privat [Mon, 21 Jul 2014 15:49:23 +0000 (11:49 -0400)]
test: convert writable to annotations

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

9 years agomodelize_property: accept annotation `writable`
Jean Privat [Mon, 21 Jul 2014 15:41:52 +0000 (11:41 -0400)]
modelize_property: accept annotation `writable`

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

9 years agocontrib/jwrapper: Added UNDEFINED to javap_visitor.res in sav
Frédéric Vachon [Mon, 21 Jul 2014 15:36:27 +0000 (11:36 -0400)]
contrib/jwrapper: Added UNDEFINED to javap_visitor.res in sav

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

9 years agocontrib/jwrapper: Added code generation module with code conversion maps
Frédéric Vachon [Sun, 13 Jul 2014 21:11:46 +0000 (17:11 -0400)]
contrib/jwrapper: Added code generation module with code conversion maps

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

9 years agocontrib/jwrapper: Added AST visitor for data extraction
Frédéric Vachon [Sun, 13 Jul 2014 21:10:22 +0000 (17:10 -0400)]
contrib/jwrapper: Added AST visitor for data extraction

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

9 years agocontrib/jwrapper: Definition of a grammar to parse javap output
Frédéric Vachon [Sun, 13 Jul 2014 21:08:24 +0000 (17:08 -0400)]
contrib/jwrapper: Definition of a grammar to parse javap output

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

9 years agotests: add base_init_noinit
Jean Privat [Mon, 21 Jul 2014 14:58:43 +0000 (10:58 -0400)]
tests: add base_init_noinit

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

9 years agoengine: skip noinit attributes on free constructors
Jean Privat [Mon, 21 Jul 2014 14:57:43 +0000 (10:57 -0400)]
engine: skip noinit attributes on free constructors

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

9 years agomodelize_property: understand `noinit` annotation on attributes
Jean Privat [Mon, 21 Jul 2014 14:57:11 +0000 (10:57 -0400)]
modelize_property: understand `noinit` annotation on attributes

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

9 years agoannotation: add `get_single_annotation` and `get_annotations`
Jean Privat [Mon, 21 Jul 2014 14:55:08 +0000 (10:55 -0400)]
annotation: add `get_single_annotation` and `get_annotations`

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

9 years agoMerge: Neo4j: bug fixes and improvments
Jean Privat [Mon, 21 Jul 2014 14:44:32 +0000 (10:44 -0400)]
Merge: Neo4j: bug fixes and improvments

Changes:
* avoid node duplication by force loading nodes from local store
* better handling of big graphes through separation of nodes and edges loading
* try to speed things up with nodes data preloading from `nodes_with_labels` response

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

9 years agoMerge: Implement FFI global references in nitg
Jean Privat [Mon, 21 Jul 2014 14:44:17 +0000 (10:44 -0400)]
Merge: Implement FFI global references in nitg

Finally follows the spec of the FFI.

Works with the `minesweeper` test case by @Freddrickk, but not with nitvm #582 (more on that later).

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

9 years agoMerge: Annotation helper
Jean Privat [Mon, 21 Jul 2014 14:44:04 +0000 (10:44 -0400)]
Merge: Annotation helper

New module `annotation` that factorize some common code on users of annotations.

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

9 years agoMerge: src: some documentation on parser and model
Jean Privat [Mon, 21 Jul 2014 14:43:55 +0000 (10:43 -0400)]
Merge: src: some documentation on parser and model

So that the new nitdoc has something to display

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

9 years agosrc: some documentation on parser and model
Jean Privat [Mon, 21 Jul 2014 13:27:24 +0000 (09:27 -0400)]
src: some documentation on parser and model

9 years agotests: add friendz related sav
Jean Privat [Fri, 11 Jul 2014 02:29:50 +0000 (22:29 -0400)]
tests: add friendz related sav

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

9 years agocontrib: introduce the game friendz
Jean Privat [Thu, 10 Jul 2014 15:58:36 +0000 (11:58 -0400)]
contrib: introduce the game friendz

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

9 years agoMerge: src/android: Modified annotations names to avoid ambiguities
Jean Privat [Mon, 21 Jul 2014 01:00:52 +0000 (21:00 -0400)]
Merge: src/android: Modified annotations names to avoid ambiguities

As discussed with @xymus, modified the 3 recently merged annotations names from `min_sdk_version`, `target_sdk_version`, `max_sdk_version` to `min_api_version`, `target_api_version`, `max_api_version` to avoid ambiguities as the android documentation related to these AndroidManifest entries always refers to it as *API Level* settings.

#568 depends on this PR because the annotations will be renamed on the test files.

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

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

9 years agoMerge: Nity interface to Sqlite3 (A nicer wrapper to the old low-level Sqlite3 module)
Jean Privat [Mon, 21 Jul 2014 01:00:47 +0000 (21:00 -0400)]
Merge: Nity interface to Sqlite3 (A nicer wrapper to the old low-level Sqlite3 module)

No exposed extern classes, `is_open` method and an iterator!

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

9 years agosrc/android: Changed annotations names to avoid ambiguities
Frédéric Vachon [Sun, 20 Jul 2014 19:28:56 +0000 (15:28 -0400)]
src/android: Changed annotations names to avoid ambiguities

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

9 years agomodel: implements MType::name
Alexandre Terrasa [Sun, 20 Jul 2014 16:37:09 +0000 (12:37 -0400)]
model: implements MType::name

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

9 years agoneo4j: preload data from `nodes_with_label` response.
Alexandre Terrasa [Sun, 20 Jul 2014 16:24:19 +0000 (12:24 -0400)]
neo4j: preload data from `nodes_with_label` response.

Speed things a little up with this shortcut.

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

9 years agoneo4j: save and load edges separately from nodes.
Alexandre Terrasa [Sun, 20 Jul 2014 16:23:15 +0000 (12:23 -0400)]
neo4j: save and load edges separately from nodes.

Edges must be laoded manually by the user, this allow him to control
the way nodes and edges are loaded in memory and avoir out of memory
exception on big graphs.

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

9 years agoneo4j: try to load nodes from `local_nodes`
Alexandre Terrasa [Sun, 20 Jul 2014 16:20:43 +0000 (12:20 -0400)]
neo4j: try to load nodes from `local_nodes`

Avoid duplication of nodes from `load_node` service.

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

9 years agotests: set nitvm_args3 as undefined
Alexis Laferrière [Sat, 19 Jul 2014 15:28:58 +0000 (11:28 -0400)]
tests: set nitvm_args3 as undefined

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

9 years agonitvm: replace hack by incr_refs
Alexis Laferrière [Sat, 19 Jul 2014 00:11:03 +0000 (20:11 -0400)]
nitvm: replace hack by incr_refs

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

9 years agosrc: use the new module annotation in exising modules
Jean Privat [Sat, 19 Jul 2014 03:20:53 +0000 (23:20 -0400)]
src: use the new module annotation in exising modules

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

9 years agosrc: new module annoation to help with annotations
Jean Privat [Sat, 19 Jul 2014 03:19:18 +0000 (23:19 -0400)]
src: new module annoation to help with annotations

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

9 years agotests: test incr_ref with lots of short-lived (in Nit) objects
Alexis Laferrière [Sat, 19 Jul 2014 02:22:48 +0000 (22:22 -0400)]
tests: test incr_ref with lots of short-lived (in Nit) objects

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

9 years agoFFI: implement the global reference functions
Alexis Laferrière [Fri, 18 Jul 2014 23:40:55 +0000 (19:40 -0400)]
FFI: implement the global reference functions

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

9 years agoFFI: use libgc allocs
Alexis Laferrière [Fri, 18 Jul 2014 17:57:10 +0000 (13:57 -0400)]
FFI: use libgc allocs

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

9 years agoMerge: nitg: Added 3 annotations related to API level target and support for Android...
Jean Privat [Fri, 18 Jul 2014 18:57:50 +0000 (14:57 -0400)]
Merge: nitg: Added 3 annotations related to API level target and support for Android projects

It enables to add the minimum, maximum and target API level annotations in android projects. The annotations are as follows :
~~~
min_sdk_version(Int)
max_sdk_version(Int)
target_sdk_version(Int)
~~~

The target is the API used to build the project, the minimum sdk version specifies the minimum android API needed to run the app and the maximum is the maximum API level that can run the app. This PR allows to build for all android platforms instead of API 10 and below only. (API are platform versions)

The tests are structured to conform to #568. When #568 will me merged, the tests will have to be imported in `complete_mnit_android.nit`.
Won't compile before #580 is merged.

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

9 years agoMerge: Attributes access with perfect hashing in nitvm
Jean Privat [Fri, 18 Jul 2014 18:53:42 +0000 (14:53 -0400)]
Merge: Attributes access with perfect hashing in nitvm

Runtime structures for accessing attributes in objects of the source program are now calculated.
Attributes access in runtime objects of the virtual machine is now functionnal with perfect hashing.

And some changes to improve the code in vm.nit

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

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

9 years agonitvm: fix a crash caused by a bad allocation of virtual tables
Julien Pagès [Fri, 18 Jul 2014 14:24:23 +0000 (16:24 +0200)]
nitvm: fix a crash caused by a bad allocation of virtual tables

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

9 years agonitvm: use perfect hashing for atribute access
Julien Pagès [Wed, 16 Jul 2014 13:10:33 +0000 (15:10 +0200)]
nitvm: use perfect hashing for atribute access

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

9 years agotests: test some errors of sqlite3
Alexis Laferrière [Thu, 17 Jul 2014 18:09:16 +0000 (14:09 -0400)]
tests: test some errors of sqlite3

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

9 years agolib/sqlite3: store and use the error code of a failed database opening
Alexis Laferrière [Thu, 17 Jul 2014 18:04:28 +0000 (14:04 -0400)]
lib/sqlite3: store and use the error code of a failed database opening

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

9 years agoMerge: remove unmaintained documentation: developpez and nitreference
Jean Privat [Fri, 18 Jul 2014 16:50:31 +0000 (12:50 -0400)]
Merge: remove unmaintained documentation: developpez and nitreference

Maybe things from `developpez` (form early 2011) could be updated an put on the website?

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

9 years agoMerge: nitunit: remove a deprecated TODO
Jean Privat [Fri, 18 Jul 2014 16:50:26 +0000 (12:50 -0400)]
Merge: nitunit: remove a deprecated TODO

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

9 years agotests: add a test for the Nity sqlite3 module
Alexis Laferrière [Wed, 16 Jul 2014 16:49:46 +0000 (12:49 -0400)]
tests: add a test for the Nity sqlite3 module

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

9 years agolib/sqlite3: intro nity interface
Alexis Laferrière [Wed, 16 Jul 2014 15:28:17 +0000 (11:28 -0400)]
lib/sqlite3: intro nity interface

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

9 years agoMerge: Fix asnotnull
Jean Privat [Fri, 18 Jul 2014 02:32:41 +0000 (22:32 -0400)]
Merge: Fix asnotnull

Add warnings on useless as(not null)  (one less TODO) and fix the bug on non-null primitives.

Fixes #589

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

9 years agoneo4j: remove some as(notnull) to supress warnings
Jean Privat [Fri, 18 Jul 2014 12:56:03 +0000 (08:56 -0400)]
neo4j: remove some as(notnull) to supress warnings

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

9 years agoMerge 'origin/master' into fix-asnotnull to supress new warnings
Jean Privat [Fri, 18 Jul 2014 13:24:30 +0000 (09:24 -0400)]
Merge 'origin/master' into fix-asnotnull to supress new warnings

9 years agonitvm: clean the code and add some comments
Julien Pagès [Wed, 16 Jul 2014 13:08:42 +0000 (15:08 +0200)]
nitvm: clean the code and add some comments

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

9 years agoniti: add write_attribute as a unique entry point
Julien Pagès [Wed, 16 Jul 2014 14:17:12 +0000 (16:17 +0200)]
niti: add write_attribute as a unique entry point

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

9 years agonitunit: remove a deprecated TODO
Jean Privat [Fri, 18 Jul 2014 00:58:50 +0000 (20:58 -0400)]
nitunit: remove a deprecated TODO

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

9 years agoMerge: lib: Introduce neo4j connector
Jean Privat [Thu, 17 Jul 2014 21:39:09 +0000 (17:39 -0400)]
Merge: lib: Introduce neo4j connector

La même avec curl et json embarqués.

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

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

9 years agoMerge: Clean up GCC warnings on Android compilation
Jean Privat [Thu, 17 Jul 2014 21:39:00 +0000 (17:39 -0400)]
Merge: Clean up GCC warnings on Android compilation

Corrects a bug, and avoid an error from #589

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

9 years agoMerge: Toward the kill of oldstyle attributes
Jean Privat [Thu, 17 Jul 2014 19:28:39 +0000 (15:28 -0400)]
Merge: Toward the kill of oldstyle attributes

The transition from old-style to new-style attributes is a mess (cf. #280)
So in order to facilitate the transition, this patch enable the access to the internal attribute previously hidden by then new_style attribute.

Therefore, the transition path is simpler since one can move declaration from old-style to new-style but some access can still use the old `_foo` notation.

Note, the `_foo` access is not mean to be publicized bu only made available for specific short-term workarounds and transitions.

Practically, internal attribute named are prefixed with `_` and made visible (but private)

~~~
class A
   var foo: Int # introduce `foo`, `foo=` and, now, `_foo`
   fun bar do print _foo # Valid, it is a direct access to the real attribute behind the service `foo`
end
~~~

Note: because of bootstrap issues (in lib and parser), the remaining old-style attribute declarations remain and will be nuked in a future point after the regeneration of c_src

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

9 years agoMerge: Some more syntax
Jean Privat [Thu, 17 Jul 2014 19:28:31 +0000 (15:28 -0400)]
Merge: Some more syntax

Just a preparation for the next c_src where new syntax is injected.

The only one fully implemented is anonymous label

~~~.rb
do
   for i in coll do if i == 0 then break label
   stuff
end label
~~~

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

9 years agoMerge: Multiple compilation
Jean Privat [Thu, 17 Jul 2014 19:28:25 +0000 (15:28 -0400)]
Merge: Multiple compilation

This (long?) PR has a simple goal, enable the compilation of multiple main programs in a single `nitg` execution.

~~~
$ bin/nitg src/nit*.nit --dir bin
~~~

The point is to factorize the shared frontend parts.
The previous single command takes 49s, so it is nice improvement on the current 1m10s total required to compile each one independently.

Under the hood, only the frontend (parsing, model, typing, etc.) is shared.
It means that a full code generation phase (`run_global_phase`) is executed for each main modules.
This allows to mix platforms or having global optimizations specific to each main program.

~~~
$ bin/nitg contrib/pep8analysis/src/pep8analysis.nit contrib/pep8analysis/src/pep8analysis_web.nit
~~~

This PR is long because some issues in the current code needed to be solved first:
* some parts in coloration assumed that all entities of the model belong to the compiled programs.
* some parts in the ffi attach some compilation inforrmation to the model or ast objects
* some platform-related things modified values in the command-line options in toolcontext

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

9 years agotests: remove remaining old-style attributes declarations
Jean Privat [Tue, 15 Jul 2014 20:13:57 +0000 (16:13 -0400)]
tests: remove remaining old-style attributes declarations

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

9 years agotests: inmprove base_as_notnull*.nit and update tests
Jean Privat [Thu, 17 Jul 2014 18:35:07 +0000 (14:35 -0400)]
tests: inmprove base_as_notnull*.nit and update tests

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

9 years agocomp: skip .as(not null) on not pointer values
Jean Privat [Thu, 17 Jul 2014 18:28:11 +0000 (14:28 -0400)]
comp: skip .as(not null) on not pointer values

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

9 years agotyping: warn for useless .as(not null)
Jean Privat [Thu, 17 Jul 2014 18:27:22 +0000 (14:27 -0400)]
typing: warn for useless .as(not null)

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

9 years agotests: rename and update low-level sqlite3 test
Alexis Laferrière [Wed, 16 Jul 2014 16:45:39 +0000 (12:45 -0400)]
tests: rename and update low-level sqlite3 test

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

9 years agocode: remove useless as(not null)
Jean Privat [Thu, 17 Jul 2014 17:50:26 +0000 (13:50 -0400)]
code: remove useless as(not null)

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

9 years agolib/android: remove useless as(not null) from audio
Alexis Laferrière [Thu, 17 Jul 2014 17:27:11 +0000 (13:27 -0400)]
lib/android: remove useless as(not null) from audio

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

9 years agoFFI with Java: correctly resolve the return types of callback to Nit from Java
Alexis Laferrière [Thu, 17 Jul 2014 17:25:50 +0000 (13:25 -0400)]
FFI with Java: correctly resolve the return types of callback to Nit from Java

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

9 years agolib: introduce neo4j connector
Alexandre Terrasa [Thu, 17 Jul 2014 16:15:51 +0000 (12:15 -0400)]
lib: introduce neo4j connector

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

9 years agoMerge: Phasify nitdoc
Jean Privat [Thu, 17 Jul 2014 15:17:04 +0000 (11:17 -0400)]
Merge: Phasify nitdoc

Launch nitdoc as a global phase (like metrics or nitg)

First commit is a cleanup that really detach doc/* from the modelbuilder.

Then some cleanup on `is_fictive`

Following commit remove the class NitdocContext and use ToolContext instead.

Last commit create add NitdocPhase that just instantiate and run Nitdoc.

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

9 years agoMerge: Test nitvm
Jean Privat [Thu, 17 Jul 2014 15:16:17 +0000 (11:16 -0400)]
Merge: Test nitvm

Add the engine `nitvm` in tests.sh so the developers of the vm can rely on the complex test framework.

1. compile nitvm (put it in src/ or bin/)
2. `$ cd tests`
3. `$ ./tests.sh --engine nitvm base*.nit` for some tests
4. `$ ./testfull.sh --engine nitvm` for all tests (long!)

Note: currently some tests (typing related) fails.
Note2: once the vm pass all tests, a new PR is needed so it is automatically built and tested.

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

9 years agoremove unmaintained documentation: developpez and nitreference
Jean Privat [Thu, 17 Jul 2014 14:12:38 +0000 (10:12 -0400)]
remove unmaintained documentation: developpez and nitreference

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

9 years agonitdoc: use global phase (process_mainmodule)
Jean Privat [Thu, 17 Jul 2014 01:50:35 +0000 (21:50 -0400)]
nitdoc: use global phase (process_mainmodule)

9 years agonitdoc: replace NitdocContext by ToolContext
Jean Privat [Thu, 17 Jul 2014 01:29:11 +0000 (21:29 -0400)]
nitdoc: replace NitdocContext by ToolContext

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

9 years agomodelbuilder: automatic mainmodule from run_global_phases is fictive
Jean Privat [Thu, 17 Jul 2014 14:00:15 +0000 (10:00 -0400)]
modelbuilder: automatic mainmodule from run_global_phases is fictive

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

9 years agomodel: promote `is_fictive` from doc_model
Jean Privat [Thu, 17 Jul 2014 13:58:21 +0000 (09:58 -0400)]
model: promote `is_fictive` from doc_model

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

9 years agodoc: use `is_fictive` instead of relying on the module name
Jean Privat [Thu, 17 Jul 2014 13:52:21 +0000 (09:52 -0400)]
doc: use `is_fictive` instead of relying on the module name

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

9 years agomarkdown: privately import things and uptate clients
Jean Privat [Thu, 17 Jul 2014 01:48:23 +0000 (21:48 -0400)]
markdown: privately import things and uptate clients

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

9 years agotests.sh: introduce new engine nitvm
Jean Privat [Thu, 17 Jul 2014 01:09:04 +0000 (21:09 -0400)]
tests.sh: introduce new engine nitvm

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

9 years agotests.sh: use variable isinterpret instead of hard-coded checks
Jean Privat [Thu, 17 Jul 2014 01:08:02 +0000 (21:08 -0400)]
tests.sh: use variable isinterpret instead of hard-coded checks

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