nit.git
9 years agoMerge: Tired of having to remember all the Nit options? Try bash_completion!
Jean Privat [Wed, 23 Jul 2014 20:33:16 +0000 (16:33 -0400)]
Merge: Tired of having to remember all the Nit options? Try bash_completion!

This PR enables the option --gen-bash-completion that allow user to generate a bash completion file.

Exemple with `nitdoc`:

    $ nitdoc --gen-bash-completion
    $ sudo ln -s <nitdir>/bin/nitdoc.bash /etc/bash_completion.d/nitdoc
    $ . /etc/bash_completion.d/nitdoc

Then:

    $ nitdoc [TAB][TAB]
    $ file1.nit    file2.nit    file3.nit

    $ nitdoc --[TAB][TAB]
    --bash-toolname         --github-base-sha1      --no-dot                --sharedir
    --custom-brand          --github-gitdir         --only-metamodel        --shareurl
    --custom-footer-text    --github-upstream       --only-parse            --source
    --custom-overview-text  --help                  --path                  --stop-on-first-error
    --custom-title          --ignore-visibility     --piwik-site-id         --verbose
    --dir                   --log                   --piwik-tracker         --version
    --disable-phase         --log-dir               --private               --warn
    --gen-bash-completion   --no-color              --quiet

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

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

9 years agoMerge: rename Sys::args
Jean Privat [Wed, 23 Jul 2014 18:22:58 +0000 (14:22 -0400)]
Merge: rename Sys::args

A step towards #461 since I do not want to do a mass migration.

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

9 years agoMerge: Opts: small improvement
Jean Privat [Wed, 23 Jul 2014 18:22:54 +0000 (14:22 -0400)]
Merge: Opts: small improvement

- syntax & comment
- hide an option
- fix an old bug

This rewrites and closes #531

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

9 years agoMerge: Add annotation `fixed` for virtual types
Jean Privat [Wed, 23 Jul 2014 18:22:52 +0000 (14:22 -0400)]
Merge: Add annotation `fixed` for virtual types

Fixed virtual types prevent redefinition is subclasses

~~~
class A
   type F: Foo is fixed
end
class B
   super A
   redef type F: Foo # Static error
end
~~~

Currently, there is no really apparent benefit of fixed virtual types because the hack of `typing::check_subtype`. Thus this is only a step toward the resolution of #298.

Note: the first commits introduce the basic verification on redefinitons of virtual types that is missing; but nobody saw that there was no checks.

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

9 years agoMerge: Introduce `neo`: a model saver/loader from/to neo4j.
Jean Privat [Wed, 23 Jul 2014 18:22:49 +0000 (14:22 -0400)]
Merge: Introduce `neo`: a model saver/loader from/to neo4j.

The `neo` module can be used to save or load a model from a Neo4j graph database.

Next pull requests will bring tools based on `neo`.

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

9 years agotests: add `test_toolcontext`
Alexandre Terrasa [Wed, 23 Jul 2014 17:28:33 +0000 (13:28 -0400)]
tests: add `test_toolcontext`

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

9 years agotests: add `test_neo`
Alexandre Terrasa [Mon, 21 Jul 2014 14:38:42 +0000 (10:38 -0400)]
tests: add `test_neo`

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

9 years agotests: introduces `test_prog` a program that build a fake documented model to test...
Alexandre Terrasa [Mon, 21 Jul 2014 14:38:12 +0000 (10:38 -0400)]
tests: introduces `test_prog` a program that build a fake documented model to test model related tools.

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

9 years agosrc: Introduces `neo` a module for save and load Nit models intro a Neo4j graph database.
Alexandre Terrasa [Mon, 21 Jul 2014 14:36:12 +0000 (10:36 -0400)]
src: Introduces `neo` a module for save and load Nit models intro a Neo4j graph database.

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

9 years agoneo4j: add `save_entity` shortcut in NeoBatch.
Alexandre Terrasa [Wed, 23 Jul 2014 17:06:13 +0000 (13:06 -0400)]
neo4j: add `save_entity` shortcut in NeoBatch.

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

9 years agoneo4j: add `with_labels` to load node having multiple labels in one Cypher query.
Alexandre Terrasa [Mon, 21 Jul 2014 14:35:05 +0000 (10:35 -0400)]
neo4j: add `with_labels` to load node having multiple labels in one Cypher query.

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

9 years agolib/standard: assert "/home/../".simplify_path == "/"
Jean Privat [Wed, 23 Jul 2014 16:48:41 +0000 (12:48 -0400)]
lib/standard: assert "/home/../".simplify_path == "/"

Fixes #614

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

9 years agotoolcontext: add `bash_completion` generation option for nit tools.
Alexandre Terrasa [Wed, 23 Jul 2014 16:28:21 +0000 (12:28 -0400)]
toolcontext: add `bash_completion` generation option for nit tools.

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

9 years agotemplate: add `Template::addn` service
Alexandre Terrasa [Tue, 15 Jul 2014 19:17:24 +0000 (15:17 -0400)]
template: add `Template::addn` service

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

9 years agotoolcontext: provide option `set-dummy-tool` used to fix the `toolname` and `version...
Alexandre Terrasa [Wed, 23 Jul 2014 16:27:28 +0000 (12:27 -0400)]
toolcontext: provide option `set-dummy-tool` used to fix the `toolname` and `version` services so they return respectively "DUMMY_TOOL" and "DUMMY_VERSION".

Useful for testing.

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

9 years agotests: extends test_opts for grouped single options
Jean Privat [Wed, 23 Jul 2014 01:30:49 +0000 (21:30 -0400)]
tests: extends test_opts for grouped single options

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 agotyping: remove hack for top-level method `args`
Jean Privat [Wed, 23 Jul 2014 01:45:20 +0000 (21:45 -0400)]
typing: remove hack for top-level method `args`

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

9 years agolib/standard: distinguish `args` and `sys.args`
Jean Privat [Wed, 23 Jul 2014 01:43:36 +0000 (21:43 -0400)]
lib/standard: distinguish `args` and `sys.args`

The former is now a genuine top-level method.
The latter is now called `sys.program_args`.

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

9 years agoopts: fix crash on grouped single options
Jean Privat [Wed, 23 Jul 2014 01:29:48 +0000 (21:29 -0400)]
opts: fix crash on grouped single options

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

9 years agoopts: added possibility to hide an option from the usage (easter egg?)
Maxime Leroy [Thu, 26 Jun 2014 19:14:07 +0000 (15:14 -0400)]
opts: added possibility to hide an option from the usage (easter egg?)

Signed-off-by: Maxime Leroy <maxime.leroy76@gmail.com>

9 years agoopts: added some obvious comments and fixed some syntax
Maxime Leroy [Thu, 26 Jun 2014 19:05:25 +0000 (15:05 -0400)]
opts: added some obvious comments and fixed some syntax

Signed-off-by: Maxime Leroy <maxime.leroy76@gmail.com>

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 agoMerge: Fix Android app name
Jean Privat [Tue, 22 Jul 2014 20:33:17 +0000 (16:33 -0400)]
Merge: Fix Android app name

Fixes the error reported by @privat

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

9 years agoMerge: Serialization: use model to get attribute types & `auto_serializable` implies...
Jean Privat [Tue, 22 Jul 2014 20:10:01 +0000 (16:10 -0400)]
Merge: Serialization: use model to get attribute types & `auto_serializable` implies `super Serializable`

The `auto_serializable` implies `super Serializable` part is up for discussion. It cleans up the code, but the code could no more be compatible with engines that do not handle the annotation.

Next there will be a tool (and/or a phase) to generate support to deserialize generic types.

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

9 years agoMerge: mnit_simple : Refactoring of android modules tests
Jean Privat [Tue, 22 Jul 2014 19:49:21 +0000 (15:49 -0400)]
Merge: mnit_simple : Refactoring of android modules tests

All mnit_simple tests have been refactored to multiple test files allowing to run tests on a module basis. A new folder named `tests` has been created containing these tests. Each test now has a Makefile entry based on that rule : `test_Module_Name`.

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

9 years agoMerge: nitmetrics: fix typo in usage text
Jean Privat [Tue, 22 Jul 2014 19:49:14 +0000 (15:49 -0400)]
Merge: nitmetrics: fix typo in usage text

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

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

9 years agoexamples: add an app_name to mnit_moles
Alexis Laferrière [Tue, 22 Jul 2014 19:10:37 +0000 (15:10 -0400)]
examples: add an app_name to mnit_moles

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

9 years agoandroid: fix app_name in res
Alexis Laferrière [Tue, 22 Jul 2014 19:10:22 +0000 (15:10 -0400)]
android: fix app_name in res

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

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 agotest: update serialization tests use of attributes and super class declaration
Alexis Laferrière [Tue, 22 Jul 2014 12:37:45 +0000 (08:37 -0400)]
test: update serialization tests use of attributes and super class declaration

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

9 years agomodel: silence warnings on multiple declaration of superclasses from artifical code
Alexis Laferrière [Mon, 21 Jul 2014 13:52:14 +0000 (09:52 -0400)]
model: silence warnings on multiple declaration of superclasses from artifical code

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

9 years agoserialization: use a post model phase to set expected attributes type
Alexis Laferrière [Mon, 21 Jul 2014 13:14:20 +0000 (09:14 -0400)]
serialization: use a post model phase to set expected attributes type

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

9 years agoserialization: move type_name to AType and apply recursively
Alexis Laferrière [Mon, 21 Jul 2014 13:10:56 +0000 (09:10 -0400)]
serialization: move type_name to AType and apply recursively

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

9 years agoserialization: correctly detect generic types
Alexis Laferrière [Mon, 21 Jul 2014 00:24:46 +0000 (20:24 -0400)]
serialization: correctly detect generic types

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

9 years agoserialization: automaticly add Serializable to auto_serializable classes
Alexis Laferrière [Mon, 21 Jul 2014 00:22:40 +0000 (20:22 -0400)]
serialization: automaticly add Serializable to auto_serializable classes

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

9 years agonitmetrics: fix typo in usage text
Alexis Laferrière [Sun, 20 Jul 2014 14:40:42 +0000 (10:40 -0400)]
nitmetrics: fix typo in usage text

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

9 years agoMerge: fix Int#to_s and migrate Java FFI Int to longs
Jean Privat [Tue, 22 Jul 2014 17:26:29 +0000 (13:26 -0400)]
Merge: fix Int#to_s and migrate Java FFI Int to longs

A rewrite that closes #592 and closes #458

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

9 years agoMerge: Add annotation lazy on attributes
Jean Privat [Tue, 22 Jul 2014 17:26:27 +0000 (13:26 -0400)]
Merge: Add annotation lazy on attributes

This annotation is basically a better `cached`.

~~~
class A
   var foo: Foo = some_complex_computation is lazy
end
var a = new A # no complex computation done yet
print a.foo # complex computation is done here
~~~

Unlike cached, the attribute is visible, and if a setter is available, the lazy can be sortcut. Thus lazy is behaving like a default value.

~~~
var b = new A
b.foo = new Foo # set before get,
print b.foo # thus complex computation is never done!
~~~

Note that with `readonly` #604 the setter can be unavailable, thus having lazy the only way to initialyze attributes.

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

9 years agolib/android: Removed simple_android UNDEFINED from nitg-g and nitg-sg sav
Frédéric Vachon [Tue, 22 Jul 2014 15:55:25 +0000 (11:55 -0400)]
lib/android: Removed simple_android UNDEFINED from nitg-g and nitg-sg sav

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

9 years agotests: add base_attr_lazy
Jean Privat [Tue, 22 Jul 2014 14:53:49 +0000 (10:53 -0400)]
tests: add base_attr_lazy

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

9 years agosrc: intro `parse_superclass`
Alexis Laferrière [Mon, 21 Jul 2014 00:10:47 +0000 (20:10 -0400)]
src: intro `parse_superclass`

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

9 years agonitg: reorder extern-classes phase
Alexis Laferrière [Mon, 21 Jul 2014 00:08:16 +0000 (20:08 -0400)]
nitg: reorder extern-classes phase

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

9 years agolib/serialization: print errors when a type cannot be deserialized
Alexis Laferrière [Wed, 18 Jun 2014 16:53:15 +0000 (12:53 -0400)]
lib/serialization: print errors when a type cannot be deserialized

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

9 years agoniti: implements lazy in the getter using isset
Jean Privat [Mon, 21 Jul 2014 20:19:15 +0000 (16:19 -0400)]
niti: implements lazy in the getter using isset

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

9 years agoniti: extract attribute expr evaluation in its own method
Jean Privat [Mon, 21 Jul 2014 20:17:43 +0000 (16:17 -0400)]
niti: extract attribute expr evaluation in its own method

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

9 years agoniti: Interpretor provides a service isset_attribute
Jean Privat [Mon, 21 Jul 2014 20:04:23 +0000 (16:04 -0400)]
niti: Interpretor provides a service isset_attribute

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

9 years agoniti: clean AAttrPropdef#call
Jean Privat [Mon, 21 Jul 2014 20:03:52 +0000 (16:03 -0400)]
niti: clean AAttrPropdef#call

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

9 years agocomp: compile `lazy` in the getter
Jean Privat [Mon, 21 Jul 2014 19:59:36 +0000 (15:59 -0400)]
comp: compile `lazy` in the getter

For primitive and nullables, lazy is implemented with an additionnal
boolean attribute used as a guard.
The guard is also update in the setter.

For nonnullable val*, lazy is implemented with issset that is currently
only correctly implemented in this subcase.

One isset has a good implementation, the guard implemnatation can be
removed.

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

9 years agocomp: clean AAttrPropdef#compile_to_c
Jean Privat [Mon, 21 Jul 2014 19:58:00 +0000 (15:58 -0400)]
comp: clean AAttrPropdef#compile_to_c

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

9 years agomodelize_property: add a guard for lazy attributes
Jean Privat [Tue, 22 Jul 2014 02:27:20 +0000 (22:27 -0400)]
modelize_property: add a guard for lazy attributes

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

9 years agomodelize_property: add annotation `lazy`
Jean Privat [Mon, 21 Jul 2014 19:58:45 +0000 (15:58 -0400)]
modelize_property: add annotation `lazy`

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

9 years agolib/android: update to Java `long` to represent a Nit `Int`
Jean Privat [Tue, 22 Jul 2014 11:54:41 +0000 (07:54 -0400)]
lib/android: update to Java `long` to represent a Nit `Int`

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

9 years agoFFI with Java: use Java long instead of int to represent Nit's Int
Alexis Laferrière [Thu, 17 Jul 2014 18:57:40 +0000 (14:57 -0400)]
FFI with Java: use Java long instead of int to represent Nit's Int

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

9 years agonitg/ffi: Nit Int are C longs
Alexis Laferrière [Mon, 12 May 2014 19:11:39 +0000 (15:11 -0400)]
nitg/ffi: Nit Int are C longs

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

9 years agolib/standard: Fixed implementation of to_s in Int.
Lucas Bajolet [Mon, 12 May 2014 20:22:54 +0000 (16:22 -0400)]
lib/standard: Fixed implementation of to_s in Int.

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

9 years agoneo4j: add nitunit for `Neo4jClient::nodes_with_label`
Alexandre Terrasa [Tue, 22 Jul 2014 03:20:58 +0000 (23:20 -0400)]
neo4j: add nitunit for `Neo4jClient::nodes_with_label`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.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 agolib/android: Added complete_simple_android.res to sav
Frédéric Vachon [Sun, 20 Jul 2014 21:31:36 +0000 (17:31 -0400)]
lib/android: Added complete_simple_android.res to sav

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

9 years agolib/android: Changed entry to execute complete_simple_android by default
Frédéric Vachon [Sun, 20 Jul 2014 21:27:02 +0000 (17:27 -0400)]
lib/android: Changed entry to execute complete_simple_android by default

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

9 years agolib/android: mnit_simple tests refactoring
Frédéric Vachon [Sun, 20 Jul 2014 21:26:25 +0000 (17:26 -0400)]
lib/android: mnit_simple tests refactoring

Signed-off-by: Frédéric Vachon <fredvac@gmail.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>