nit.git
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 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 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 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 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>

9 years agoMerge: xdg_basedir
Jean Privat [Thu, 17 Jul 2014 00:40:08 +0000 (20:40 -0400)]
Merge: xdg_basedir

Will also be used to implement #559.

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

9 years agotests: update test_parser
Jean Privat [Wed, 16 Jul 2014 21:01:58 +0000 (17:01 -0400)]
tests: update test_parser

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

9 years agotests: add base_label_while2.nit for anonymous labels
Jean Privat [Mon, 14 Jul 2014 15:09:06 +0000 (11:09 -0400)]
tests: add base_label_while2.nit for anonymous labels

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

9 years agoscope: correcty handle anonynous labels
Jean Privat [Mon, 14 Jul 2014 15:08:22 +0000 (11:08 -0400)]
scope: correcty handle anonynous labels

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

9 years agoparser: regenerate with new last grammar changes
Jean Privat [Mon, 14 Jul 2014 14:36:05 +0000 (10:36 -0400)]
parser: regenerate with new last grammar changes

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

9 years agogrammer: accept redef and visibility in front of annotation
Jean Privat [Mon, 14 Jul 2014 14:25:12 +0000 (10:25 -0400)]
grammer: accept redef and visibility in front of annotation

~~~
var foo is public bar
fun baz is
   # doc
   redef private foobar
end
~~~

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

9 years agogrammar: accept redef and visibility on module declaration
Jean Privat [Thu, 26 Jun 2014 09:37:49 +0000 (05:37 -0400)]
grammar: accept redef and visibility on module declaration

The visibility on modules will hide thing inter-projects

The redef is accepted only for convenience, and could
be rejected on a latter analysis.

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

9 years agogrammar: accept annotations in implicit extern methods
Jean Privat [Wed, 18 Jun 2014 19:57:14 +0000 (15:57 -0400)]
grammar: accept annotations in implicit extern methods

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

9 years agogrammar: add elipsys notation to pass an expression in a vararg parameter
Jean Privat [Wed, 18 Jun 2014 02:17:58 +0000 (22:17 -0400)]
grammar: add elipsys notation to pass an expression in a vararg parameter

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

9 years agogrammar: accept annonymous label
Jean Privat [Wed, 18 Jun 2014 01:51:35 +0000 (21:51 -0400)]
grammar: accept annonymous label

Often, a single label is needed, for aborting some neested loops for
instance. But the programmer was forced to still gives a name to a
label. This yielded to crasy or useless names,

The proposal is to allow anonymous label.

Eg. in the following, the break breaks the x loop
~~~
for x in xs do
  for y in ys do
    stuff
    if something then break label
  end
  stuff
end label
~~~

Note: by the way, valued breaks and continues are removed.

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

9 years agogrammar: accept `public` as a valid visibility
Jean Privat [Wed, 18 Jun 2014 01:13:12 +0000 (21:13 -0400)]
grammar: accept `public` as a valid visibility

It has the same semantic than no explicit visibility, but
will allows a simpler transition to a new visibility level.

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

9 years agotest/mnit_simple: Added tests for API level related annotations
Frédéric Vachon [Wed, 16 Jul 2014 02:46:31 +0000 (22:46 -0400)]
test/mnit_simple: Added tests for API level related annotations

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

9 years agosrc/android: Added 3 metadata annotations for API Level related matters
Frédéric Vachon [Wed, 16 Jul 2014 01:55:18 +0000 (21:55 -0400)]
src/android: Added 3 metadata annotations for API Level related matters

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

9 years agomodelize_property: enable the access of the internal attributes
Jean Privat [Tue, 15 Jul 2014 20:10:44 +0000 (16:10 -0400)]
modelize_property: enable the access of the internal attributes

The transition from old-style to new-style attributes is a mess.
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)

9 years agosrc: use multicompile to fasten the initial make
Jean Privat [Wed, 16 Jul 2014 17:08:36 +0000 (13:08 -0400)]
src: use multicompile to fasten the initial make

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

9 years agotests: multicompile with nitg
Jean Privat [Wed, 16 Jul 2014 15:52:41 +0000 (11:52 -0400)]
tests: multicompile with nitg

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

9 years agotests: update base_simple_import.nit so the result difers from base_simple.nit
Jean Privat [Wed, 16 Jul 2014 15:47:57 +0000 (11:47 -0400)]
tests: update base_simple_import.nit so the result difers from base_simple.nit

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

9 years agocomp: enable multi-compilation, ie multiple main programs
Jean Privat [Tue, 15 Jul 2014 16:10:57 +0000 (12:10 -0400)]
comp: enable multi-compilation, ie multiple main programs

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

9 years agoffi: reset FFI compilation result attached to the module
Jean Privat [Tue, 15 Jul 2014 16:05:35 +0000 (12:05 -0400)]
ffi: reset FFI compilation result attached to the module

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

9 years agoffi: move guard in the AbstractCompiler
Jean Privat [Wed, 16 Jul 2014 15:40:11 +0000 (11:40 -0400)]
ffi: move guard  in the AbstractCompiler

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

9 years agoffi: move guard into the MModule to simplify management
Jean Privat [Wed, 16 Jul 2014 15:38:43 +0000 (11:38 -0400)]
ffi: move guard  into the MModule to simplify management

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

9 years agocomp: compilers do not modify opt_stacktace, it is a global info
Jean Privat [Wed, 16 Jul 2014 15:33:34 +0000 (11:33 -0400)]
comp: compilers do not modify opt_stacktace, it is a global info

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

9 years agocomp: use a local `no_main` variable
Jean Privat [Wed, 16 Jul 2014 15:18:06 +0000 (11:18 -0400)]
comp: use a local `no_main` variable

Instead of modifing the global opt_no_main option

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

9 years agocolo: rewrite build_{meth,attr}_tables
Jean Privat [Wed, 16 Jul 2014 02:50:06 +0000 (22:50 -0400)]
colo: rewrite build_{meth,attr}_tables

The current implementation has two issues.

First, it relies on the full model instead of just the main module
eg. `mproperty.mpropdefs` is full-model information

Second, the order of the refienements is fragile and may be distinct form the
one given by the model.

Therefore, this commit just remplaces the code with one that just fill
slots with information given by the model (instead of recomputed in a
fragile way)

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

9 years agocolo: Colorize only class in the module, not all in the model
Jean Privat [Tue, 15 Jul 2014 16:01:31 +0000 (12:01 -0400)]
colo: Colorize only class in the module, not all in the model

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

9 years agocolo: `MModule::properties` does no give properties is does not have
Jean Privat [Wed, 16 Jul 2014 15:35:39 +0000 (11:35 -0400)]
colo: `MModule::properties` does no give properties is does not have

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

9 years agoMerge: Fixes for attributes
Jean Privat [Wed, 16 Jul 2014 15:15:43 +0000 (11:15 -0400)]
Merge: Fixes for attributes

Some fixes and improvements in modelize_property.nit on the attributes side.

* redef optional on the `writable` part (see #270)
* fix signature check
* enable the inheritance of the type when a var redef a fun

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

9 years agoMerge: Some minor improvements to Sqlite3
Jean Privat [Wed, 16 Jul 2014 13:30:30 +0000 (09:30 -0400)]
Merge: Some minor improvements to Sqlite3

Will be used to implement #559 under Linux.

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

9 years agosqlite3: use sqlite3_close_v2
Alexis Laferrière [Wed, 16 Jul 2014 13:16:15 +0000 (09:16 -0400)]
sqlite3: use sqlite3_close_v2

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

9 years agolib/sqlite3: implement Sqlite3::is_valid
Alexis Laferrière [Fri, 11 Jul 2014 19:30:43 +0000 (15:30 -0400)]
lib/sqlite3: implement Sqlite3::is_valid

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

9 years agotests: test untyped attributes in base_attr5
Jean Privat [Tue, 15 Jul 2014 19:58:26 +0000 (15:58 -0400)]
tests: test untyped attributes in base_attr5

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

9 years agoMerge: lib/android: Typo fix for shared_preferences module
Jean Privat [Wed, 16 Jul 2014 01:32:54 +0000 (21:32 -0400)]
Merge: lib/android: Typo fix for shared_preferences module

Fixed typo and added import to shared_preferences_api11 module

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

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

9 years agoMerge: lib/curl: clean and sort options
Jean Privat [Wed, 16 Jul 2014 00:08:03 +0000 (20:08 -0400)]
Merge: lib/curl: clean and sort options

Clean and sort options, also enable new ones.

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

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

9 years agoMerge: Symetric [] & []= in android::shared_preferences
Jean Privat [Tue, 15 Jul 2014 21:59:56 +0000 (17:59 -0400)]
Merge: Symetric [] & []= in android::shared_preferences

Now SharedPreferences[]= always serialize, and [] deserialize. This would be the default dehavior for a Nit application. The other getter/setter for primitive types are still available but must be used directly.

Pull-Request: #577
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Frédéric Vachon <fredvac@gmail.com>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agolib/android: Added import and fixed typo
Frédéric Vachon [Tue, 15 Jul 2014 21:10:24 +0000 (17:10 -0400)]
lib/android: Added import and fixed typo

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

9 years agoMerge: Splay ropes
Jean Privat [Tue, 15 Jul 2014 20:19:25 +0000 (16:19 -0400)]
Merge: Splay ropes

Added Splay tree operations on ropes (see [Splay tree](http://en.wikipedia.org/wiki/Splay_tree)).

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

9 years agomodelize_properties: attributes inherit the static type of the getter
Jean Privat [Tue, 15 Jul 2014 19:50:17 +0000 (15:50 -0400)]
modelize_properties: attributes inherit the static type of the getter

so, one could write

~~~
interface A
  fun foo: String
end

class B
  super A
  redef var foo # var foo is a String!
end
~~~

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

9 years agoandroid/shared_preferences: []= always serialize to be symetric with the new []
Alexis Laferrière [Fri, 11 Jul 2014 19:32:44 +0000 (15:32 -0400)]
android/shared_preferences: []= always serialize to be symetric with the new []

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

9 years agomodelize_property: do not crash if mtype is null in check_visibility
Jean Privat [Tue, 15 Jul 2014 19:15:44 +0000 (15:15 -0400)]
modelize_property: do not crash if mtype is null in check_visibility

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

9 years agomodelize_property: correctly check signature for getter and setter
Jean Privat [Tue, 15 Jul 2014 19:14:09 +0000 (15:14 -0400)]
modelize_property: correctly check signature for getter and setter

Some clone of bug 855796228e2ea1234246990c68741ccffbce93ae

9 years agoandroid/shared_preferences: import json_serialization privately
Alexis Laferrière [Fri, 11 Jul 2014 19:32:04 +0000 (15:32 -0400)]
android/shared_preferences: import json_serialization privately

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

9 years agonitcc_runtime: force static type of Nodes::children
Jean Privat [Tue, 15 Jul 2014 19:09:53 +0000 (15:09 -0400)]
nitcc_runtime: force static type of Nodes::children

We want a mutable sequence here!

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

9 years agolib/curl: clean and sort options
Alexandre Terrasa [Fri, 11 Jul 2014 05:40:53 +0000 (01:40 -0400)]
lib/curl: clean and sort options

Also enable new ones

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

9 years agoMerge: Nitdoc standalone
Jean Privat [Tue, 15 Jul 2014 18:37:59 +0000 (14:37 -0400)]
Merge: Nitdoc standalone

Make `nitdoc` able to generate documentation only with a Model.

This will enable other clients than the actual `ModelBuilder` based one like from DB connector.

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

9 years agotests: update base_attr5 for redef policy
Jean Privat [Tue, 15 Jul 2014 17:39:20 +0000 (13:39 -0400)]
tests: update base_attr5 for redef policy

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

9 years agomodelize_property: the `redef` on writable is now optional
Jean Privat [Tue, 15 Jul 2014 17:38:49 +0000 (13:38 -0400)]
modelize_property: the `redef` on writable is now optional

fixes #270

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

9 years agoMerge: lib: introduces ini config file reader/writter
Jean Privat [Tue, 15 Jul 2014 16:14:01 +0000 (12:14 -0400)]
Merge: lib: introduces ini config file reader/writter

To handle ini files.

Pull-Request: #566
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Frédéric Vachon <fredvac@gmail.com>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agocompiler: add `--dir` to just change the output directory
Jean Privat [Tue, 15 Jul 2014 14:29:19 +0000 (10:29 -0400)]
compiler: add `--dir` to just change the output directory

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

9 years agoandroid_platform: use `outfile` instead of its own stuff
Jean Privat [Tue, 15 Jul 2014 14:25:45 +0000 (10:25 -0400)]
android_platform: use `outfile` instead of its own stuff

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

9 years agocompiler: `add MakefileToolchain::outfile` to compute outnames
Jean Privat [Tue, 15 Jul 2014 14:22:22 +0000 (10:22 -0400)]
compiler: `add MakefileToolchain::outfile` to compute outnames

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

9 years agoMerge: Structs
Jean Privat [Tue, 15 Jul 2014 13:22:56 +0000 (09:22 -0400)]
Merge: Structs

More standard data structures and algorithms

closes #512

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

9 years agoMerge: Java FFI with Java generics
Jean Privat [Tue, 15 Jul 2014 11:59:29 +0000 (07:59 -0400)]
Merge: Java FFI with Java generics

To support extern classes of Java generic types, we remove all the parameters of generic types in the JNI signature format.

Example:

    extern class QueueOfString in "Java" `{ java.util.Queue<String> `}

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

9 years agonitdoc: extract NitdocContext from Nitdoc generation
Alexandre Terrasa [Tue, 15 Jul 2014 05:53:58 +0000 (01:53 -0400)]
nitdoc: extract NitdocContext from Nitdoc generation

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

9 years agonitdoc: clean output_dir option selection
Alexandre Terrasa [Tue, 15 Jul 2014 05:38:18 +0000 (01:38 -0400)]
nitdoc: clean output_dir option selection

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

9 years agonitdoc: limit dependency to `model`
Alexandre Terrasa [Tue, 15 Jul 2014 05:30:33 +0000 (01:30 -0400)]
nitdoc: limit dependency to `model`

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

9 years agomodel_utils: limit dependency to `model`.
Alexandre Terrasa [Tue, 15 Jul 2014 05:27:07 +0000 (01:27 -0400)]
model_utils: limit dependency to `model`.

Also update tools importing `model_utils`

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

9 years agolib: introduce Heap and PriorityQueue in standard::collection
Alexandre Terrasa [Tue, 15 Jul 2014 04:47:36 +0000 (00:47 -0400)]
lib: introduce Heap and PriorityQueue in standard::collection

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

9 years agolib: introduces ini config file reader/writter
Alexandre Terrasa [Tue, 15 Jul 2014 04:17:10 +0000 (00:17 -0400)]
lib: introduces ini config file reader/writter

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

9 years agotests: test generics in Java FFI
Alexis Laferrière [Mon, 14 Jul 2014 15:14:29 +0000 (11:14 -0400)]
tests: test generics in Java FFI

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

9 years agoJava FFI: support generic Java types in extern class foreign type
Alexis Laferrière [Mon, 14 Jul 2014 15:14:07 +0000 (11:14 -0400)]
Java FFI: support generic Java types in extern class foreign type

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

9 years agotests: add test for xdg_basedir
Alexis Laferrière [Fri, 11 Jul 2014 20:40:00 +0000 (16:40 -0400)]
tests: add test for xdg_basedir

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

9 years agolib: intro xdg_basedir
Alexis Laferrière [Fri, 11 Jul 2014 14:32:37 +0000 (10:32 -0400)]
lib: intro xdg_basedir

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