nit.git
9 years agoAdded pnacl manifest.
Djomanix [Fri, 27 Jun 2014 19:59:21 +0000 (15:59 -0400)]
Added pnacl manifest.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoAdded JS files.
Djomanix [Fri, 27 Jun 2014 19:59:08 +0000 (15:59 -0400)]
Added JS files.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoAdded index and favicon.
Djomanix [Fri, 27 Jun 2014 19:58:57 +0000 (15:58 -0400)]
Added index and favicon.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoAdded CSS files.
Djomanix [Fri, 27 Jun 2014 19:58:41 +0000 (15:58 -0400)]
Added CSS files.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoAdded sources files.
Djomanix [Fri, 27 Jun 2014 19:58:20 +0000 (15:58 -0400)]
Added sources files.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoAdded setup files.
Djomanix [Fri, 27 Jun 2014 19:58:06 +0000 (15:58 -0400)]
Added setup files.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoAdded README and Makefile
Djomanix [Fri, 27 Jun 2014 19:57:50 +0000 (15:57 -0400)]
Added README and Makefile

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoMerge: No old style accessors
Jean Privat [Thu, 26 Jun 2014 19:51:50 +0000 (15:51 -0400)]
Merge: No old style accessors

Old-style accessors are those in the form

~~~
readable writable var _foo: Foo
~~~

The plan is to remove them from the grammar (and the AST and modelize_property) in future PR.
This PR only update the exisiting code to remove the remaining occurences by:

* using new-style attributes, or
* keep old style attributes with explicit getters/setters if using new-style attributes has a too big impact on the performances (or is too complex to update)

Because of performance implications, old-style attribute may remains in the language to implements some intern parts.

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

9 years agoMerge: private DFAState
Jean Privat [Thu, 26 Jun 2014 17:16:08 +0000 (13:16 -0400)]
Merge: private DFAState

nitcc genrates a bunch of subclasses of DFAState, but did not mark them private altrought they are not useful for the programme and polute the auto-documentation.

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

9 years agoMerge: PNaCl: Added 'create_thread' function in the pnacl lib.
Jean Privat [Thu, 26 Jun 2014 17:16:00 +0000 (13:16 -0400)]
Merge: PNaCl: Added 'create_thread' function in the pnacl lib.

Added 'create_thread' function to enable thread creation after a exit.

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

9 years agoMerge: Concerns sorter
Jean Privat [Thu, 26 Jun 2014 17:15:50 +0000 (13:15 -0400)]
Merge: Concerns sorter

Just replace some sorters by an MEntity sorter.

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

9 years agomodel_utils: replace many sorters by MEntityNameSorter
Alexandre Terrasa [Thu, 19 Jun 2014 20:03:34 +0000 (16:03 -0400)]
model_utils: replace many sorters by MEntityNameSorter

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

9 years agomodel_utils: add MEntityNameSorter
Alexandre Terrasa [Wed, 18 Jun 2014 18:24:51 +0000 (14:24 -0400)]
model_utils: add MEntityNameSorter

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

9 years agomodelize_property: remove old-style accesors
Jean Privat [Thu, 26 Jun 2014 10:05:47 +0000 (06:05 -0400)]
modelize_property: remove old-style accesors

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

9 years agopep8analysis: remove old-style accessors in the AST
Jean Privat [Thu, 26 Jun 2014 10:04:06 +0000 (06:04 -0400)]
pep8analysis: remove old-style accessors in the AST

Note: the transformation was done with a script.
The parser cannot seem to be regenerated.
A future move could be to use nitcc instead.

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

9 years agotests: remove remaining old-style accessors
Jean Privat [Thu, 26 Jun 2014 02:13:50 +0000 (22:13 -0400)]
tests: remove remaining old-style accessors

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

9 years agolib/json: regenerate json_lexer with private DFAStates
Jean Privat [Thu, 26 Jun 2014 09:18:48 +0000 (05:18 -0400)]
lib/json: regenerate json_lexer with private DFAStates

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

9 years agonitcc: DFAStates are private
Jean Privat [Thu, 26 Jun 2014 09:17:36 +0000 (05:17 -0400)]
nitcc: DFAStates are private

One does not want to see them in the documentation.

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

9 years agoMerge: ordered_tree: make OrderedTree implement Collection
Jean Privat [Thu, 26 Jun 2014 02:42:24 +0000 (22:42 -0400)]
Merge: ordered_tree: make OrderedTree implement Collection

OrderedTree now implement major Collection services

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

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

9 years agoparser: remove generated old-style accesors.
Jean Privat [Thu, 26 Jun 2014 02:06:23 +0000 (22:06 -0400)]
parser: remove generated old-style accesors.

ANodes use new style attributes (with two accesors)
Other use old-style attributes with two explicit getter and setters.

Using new-style attributes has a too big impact on performance because of
the redefined setter

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

9 years agoparser: remove some remaining old style accessors
Jean Privat [Thu, 26 Jun 2014 02:02:30 +0000 (22:02 -0400)]
parser: remove some remaining old style accessors

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

9 years agoMerge: names and concerns in model
Jean Privat [Thu, 26 Jun 2014 01:10:11 +0000 (21:10 -0400)]
Merge: names and concerns in model

First commit adapt the MEntity implementation to it's documentation by moving up the `name` property.

Second commit introduce a new kind of MEntity: MConcern that will be used in documentation tools as a common interface for MProject, MGroup and MModule.

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

9 years agoMerge: Model utils
Jean Privat [Wed, 25 Jun 2014 23:49:29 +0000 (19:49 -0400)]
Merge: Model utils

This pull request needs #522 to be merged.

Introduce some usefull services in model_utils for further uses in documentation tools.

Pull-Request: #523
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 agoordered_tree: add some tests
Alexandre Terrasa [Wed, 25 Jun 2014 23:12:26 +0000 (19:12 -0400)]
ordered_tree: add some tests

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

9 years agoUpdated 'create_thread' function comments.
Djomanix [Wed, 25 Jun 2014 23:09:19 +0000 (19:09 -0400)]
Updated 'create_thread' function comments.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoordered_tree: make OrderedTree a subclass of Collection and implements missing methods
Alexandre Terrasa [Wed, 25 Jun 2014 22:55:42 +0000 (18:55 -0400)]
ordered_tree: make OrderedTree a subclass of Collection and implements missing methods

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

9 years agoMerge: Rope api
Jean Privat [Wed, 25 Jun 2014 22:07:11 +0000 (18:07 -0400)]
Merge: Rope api

Small modifications of the API that will be required for future pull requests such as Splay ropes and Bufferized ropes.

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

9 years agomodel: introduce MConcern
Alexandre Terrasa [Thu, 19 Jun 2014 19:52:51 +0000 (15:52 -0400)]
model: introduce MConcern

Each MProject, MGroup and MModules represents a documentable concern.

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

9 years agomodel: introduce `name` in MEntity according to it's documentation
Alexandre Terrasa [Wed, 25 Jun 2014 21:32:34 +0000 (17:32 -0400)]
model: introduce `name` in MEntity according to it's documentation

Documentation was:
 # A named and possibly documented entity in the model.
So I added the name...

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

9 years agoMerge: Removed sockets from 'debugger.nit' to put them in a new module
Jean Privat [Wed, 25 Jun 2014 19:56:36 +0000 (15:56 -0400)]
Merge: Removed sockets from 'debugger.nit' to put them in a new module

Removed sockets from 'debugger.nit' to put them in 'debugger_socket.nit', because it caused compilation problems for the interpreter in PNaCl.

Pull-Request: #520
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
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 agomodel_utils: allow intro and redef mclasses filtering
Alexandre Terrasa [Wed, 18 Jun 2014 19:14:08 +0000 (15:14 -0400)]
model_utils: allow intro and redef mclasses filtering

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

9 years agomodel_utils: collect mmodules in mproject and mgroups
Alexandre Terrasa [Wed, 25 Jun 2014 15:24:43 +0000 (11:24 -0400)]
model_utils: collect mmodules in mproject and mgroups

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

9 years agomodel_utils: extract mclasses and mclassdefs from MProject and Mgroup
Alexandre Terrasa [Wed, 25 Jun 2014 15:24:07 +0000 (11:24 -0400)]
model_utils: extract mclasses and mclassdefs from MProject and Mgroup

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

9 years agolib/ropes_debug: Adapted new leaves for to_dot operation.
Lucas Bajolet [Mon, 23 Jun 2014 15:38:08 +0000 (11:38 -0400)]
lib/ropes_debug: Adapted new leaves for to_dot operation.

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

9 years agolib/standard/ropes: Added to_leaf method on RopeNode.
Lucas Bajolet [Mon, 23 Jun 2014 15:12:35 +0000 (11:12 -0400)]
lib/standard/ropes: Added to_leaf method on RopeNode.

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

9 years agoAdded an import for 'debugger_socket'.
Djomanix [Wed, 25 Jun 2014 18:30:36 +0000 (14:30 -0400)]
Added an import for 'debugger_socket'.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agomailcap: fix Julien Pagès
Jean Privat [Wed, 25 Jun 2014 13:12:50 +0000 (09:12 -0400)]
mailcap: fix Julien Pagès

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

9 years agoPut sockets in 'debugger_socket.nit
Djomanix [Mon, 23 Jun 2014 20:06:03 +0000 (16:06 -0400)]
Put sockets in 'debugger_socket.nit

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoRemoved sockets from 'debugger.nit' to put them in 'debugger_socket.nit
Djomanix [Mon, 23 Jun 2014 20:05:11 +0000 (16:05 -0400)]
Removed sockets from 'debugger.nit' to put them in 'debugger_socket.nit

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agoMerge: Nit for mac
Jean Privat [Mon, 23 Jun 2014 19:30:53 +0000 (15:30 -0400)]
Merge: Nit for mac

Some minor, but needed, tweaks to allow the compilation of Nit on Mac OS X

A special page is also created: http://nitlanguage.org/on_mac/

Currenlty, only 31 tests does not pass, most of them are platform or FFI related (some SDK are missing).

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

9 years agoMerge: Tests emscripten
Jean Privat [Mon, 23 Jun 2014 19:30:45 +0000 (15:30 -0400)]
Merge: Tests emscripten

The produced .js files are then executed by nodejs.

All base tests that do not import kernel are skipped because
since the module lib/emscripten.nit imports the kernel module,
an automatic double definition of classes `Object` and `Sys` occurs.

nodejs cannot perform correctly synchronized input, thus `stdin` and all
file reading does not work although they work in a browser.
As a workaround, a special module `emscripten_nodejs.nit` is added that just
print "NOT_YET_IMPLEMENTED" on unsupported services on synchronized input,
thus marking the test as skipped.

Currently, 99 (7% of the 1390 tests) still cause some other kind of failures;
they will be investigated later.

The whole testing of all the tests takes 68m on my machine.
ccache in unusable and the option --jcache of emcc does not bring any boost.
So it is unlikely that `testall.sh` will include this engine.

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

9 years agoMerge: Bench scripts
Jean Privat [Mon, 23 Jun 2014 19:29:49 +0000 (15:29 -0400)]
Merge: Bench scripts

Reunited common functions for benches in a new shell file.

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

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

9 years agoAdded 'create_thread' function to enable thread creation after a exit.
Djomanix [Mon, 23 Jun 2014 18:28:09 +0000 (14:28 -0400)]
Added 'create_thread' function to enable thread creation after a exit.

Signed-off-by: Djomanix <johan.kayser@viacesi.fr>

9 years agomkcsrc: clear OLDNITCOPT in src/Makefile
Jean Privat [Sat, 21 Jun 2014 02:31:07 +0000 (22:31 -0400)]
mkcsrc: clear OLDNITCOPT in src/Makefile

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

9 years agoc_src: update Makefile to compile on MacOSX
Jean Privat [Fri, 20 Jun 2014 19:27:12 +0000 (15:27 -0400)]
c_src: update Makefile to compile on MacOSX

Add a make variable OLDNITCOPT to give options for the first step

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

9 years agotests: update some tests to pass on Mac
Jean Privat [Fri, 20 Jun 2014 20:03:09 +0000 (16:03 -0400)]
tests: update some tests to pass on Mac

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

9 years agoMakefile: use `--no-stacktrace` on c_src/nitg to deal with the -lunwind issue on...
Jean Privat [Fri, 20 Jun 2014 19:39:16 +0000 (15:39 -0400)]
Makefile: use `--no-stacktrace` on c_src/nitg to deal with the -lunwind issue on MacOSX

9 years agotests.sh: force LC_ALL that cause issues with MacOSX
Jean Privat [Fri, 20 Jun 2014 19:28:23 +0000 (15:28 -0400)]
tests.sh: force LC_ALL that cause issues with MacOSX

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

9 years agoglobal: compiler remove a useless `const` that cause C warnings
Jean Privat [Fri, 20 Jun 2014 19:25:05 +0000 (15:25 -0400)]
global: compiler remove a useless `const` that cause C warnings

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

9 years agoabstract_compiler: remove -lunwind if target is Darwin (macosx)
Jean Privat [Fri, 20 Jun 2014 19:19:33 +0000 (15:19 -0400)]
abstract_compiler: remove -lunwind if target is Darwin (macosx)

9 years agoabstract_compiler: add -Qunused-argument if clang
Jean Privat [Fri, 20 Jun 2014 19:18:01 +0000 (15:18 -0400)]
abstract_compiler: add -Qunused-argument if clang

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

9 years agoabstract_compiler: add some flags to teach clang to be more silent
Jean Privat [Fri, 20 Jun 2014 19:13:20 +0000 (15:13 -0400)]
abstract_compiler: add some flags to teach clang to be more silent

gcc also accepts these flags, so it is OK.

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

9 years agobenchmarks: Reunited common functions for benches in a new shell file.
Lucas Bajolet [Wed, 18 Jun 2014 19:38:06 +0000 (15:38 -0400)]
benchmarks: Reunited common functions for benches in a new shell file.

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

9 years agolib/standard/ropes: Concat nodes cannot be constructed without children anymore.
Lucas Bajolet [Thu, 19 Jun 2014 17:19:07 +0000 (13:19 -0400)]
lib/standard/ropes: Concat nodes cannot be constructed without children anymore.

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

9 years agolib/standard/ropes: API change, Leaves are now abstract for future flexibility.
Lucas Bajolet [Thu, 19 Jun 2014 16:13:49 +0000 (12:13 -0400)]
lib/standard/ropes: API change, Leaves are now abstract for future flexibility.

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

9 years agoMerge: Tests nitg --semi-global
Jean Privat [Thu, 19 Jun 2014 15:01:24 +0000 (11:01 -0400)]
Merge: Tests nitg --semi-global

Some work and cleanup on tests.sh and cie.
Also add a new engine `nitg-sg` that is `nitg --semi-global`

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

9 years agotests.sh: new engine `emscripten` for `nitg -m emscripten`
Jean Privat [Wed, 18 Jun 2014 20:01:21 +0000 (16:01 -0400)]
tests.sh: new engine `emscripten` for `nitg -m emscripten`

The produced .js files are then executed by nodejs.

All base tests that do not import kernel are skipped because
since the module lib/emscripten.nit imports the kernel module,
an automatic double definition of classes `Object` and `Sys` occurs.

nodejs cannot perform correctly synchronized input, thus `stdin` and all
file reading does not work although they work in a browser.
As a workaround, a special module `emscripten_nodejs.nit` is added that just
print "NOT_YET_IMPLEMENTED" on unsupported services on synchronized input,
thus marking the test as skipped.

Currently, 99 (7% of the 1390 tests) still cause some other kind of failures;
they will be investigated later.

The whole testing of all the tests takes 68m on my machine.
ccache in unusable and the option --jcache of emcc does not bring any boost.
So it is unlikely that `testall.sh` will include this engine.

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

9 years agotests: testall.sh include nitg-sg
Jean Privat [Wed, 18 Jun 2014 16:51:25 +0000 (12:51 -0400)]
tests: testall.sh include nitg-sg

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

9 years agotests.sh: distinguish the generated file from the executed file
Jean Privat [Wed, 18 Jun 2014 16:42:05 +0000 (12:42 -0400)]
tests.sh: distinguish the generated file from the executed file

Some some future engines that does not produce directly executable files
could still use the tests.sh framework.

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

9 years agotests: add engine `nitg-sg` for --semi-global
Jean Privat [Wed, 18 Jun 2014 14:23:17 +0000 (10:23 -0400)]
tests: add engine `nitg-sg` for --semi-global

Some platforms starts using it, so better check that we do
not broke it.

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

9 years agotests: clean some .skip files (use some UNDEFINED .res)
Jean Privat [Wed, 18 Jun 2014 15:19:53 +0000 (11:19 -0400)]
tests: clean some .skip files (use some UNDEFINED .res)

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

9 years agotests: teach a res file to contains `UNDEFINED` and always match
Jean Privat [Wed, 18 Jun 2014 15:05:30 +0000 (11:05 -0400)]
tests: teach a res file to contains `UNDEFINED` and always match

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

9 years agotests: add tests for tests.sh so we can test the test script
Jean Privat [Wed, 18 Jun 2014 14:20:57 +0000 (10:20 -0400)]
tests: add tests for tests.sh so we can test the test script

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

9 years agotests.sh: soso are always detected as failed tests
Jean Privat [Wed, 18 Jun 2014 14:17:25 +0000 (10:17 -0400)]
tests.sh: soso are always detected as failed tests

A `soso` is when a test fails only because errors and warnings
differs.

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

9 years agotests.sh: less hackish way to handle fixme directories for savdirs
Jean Privat [Wed, 18 Jun 2014 13:59:21 +0000 (09:59 -0400)]
tests.sh: less hackish way to handle fixme directories for savdirs

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

9 years agotests.sh: remove tap output
Jean Privat [Wed, 18 Jun 2014 13:57:00 +0000 (09:57 -0400)]
tests.sh: remove tap output

Badly implemented and unused now since junit-xml-output

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

9 years agotests: fix base_inline
Jean Privat [Wed, 18 Jun 2014 15:25:32 +0000 (11:25 -0400)]
tests: fix base_inline

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

9 years agotests: add new lines on some tests
Jean Privat [Wed, 18 Jun 2014 15:25:02 +0000 (11:25 -0400)]
tests: add new lines on some tests

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

9 years agotests: remove some very-old useless tests
Jean Privat [Tue, 17 Jun 2014 18:29:38 +0000 (14:29 -0400)]
tests: remove some very-old useless tests

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

9 years agoMerge: Pep8analysis Web Version
Jean Privat [Wed, 18 Jun 2014 12:47:49 +0000 (08:47 -0400)]
Merge: Pep8analysis Web Version

Compiles pep8analysis to JavaScript using emscripten and expose a nice interface using Bootstrap, codemirror and viz.js.

Resulting Web app published at: http://xymus.net/pep8/

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

9 years agoMerge: Use more intern methods and add intern factories for NativeString and NativeArray
Jean Privat [Wed, 18 Jun 2014 01:58:58 +0000 (21:58 -0400)]
Merge: Use more intern methods and add intern factories for NativeString and NativeArray

The first commits enhance the parser to accept top-level intern methods (needed for `exit`) and intern `new` factories (analogous to extern `new` factories). Thus fix #493

The rest of the series implements two intern `new` factories, one for NativeString and one for NativeArray.
However, because the compiler in c_src cannot obviously parse the new syntax yet, the standard library is not updated.
So consider the file `test_new_native.nit` as a technology preview.

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

9 years agoMerge: SharedPreferences: Nit API wrapping android SharedPreferences class
Jean Privat [Wed, 18 Jun 2014 00:42:51 +0000 (20:42 -0400)]
Merge: SharedPreferences: Nit API wrapping android SharedPreferences class

A module wrapping 'android.content.SharedPreferences' allowing to load/save data to internal storage for the android platform. Some tests have been added to the mnit_simple example.

The compiler has been slightly modified to ignore '
' in java extern types.

As asked by @privat and @xymus to store persistant game data.
Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

Pull-Request: #495
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

9 years agoMerge: Include extra Java files in a project
Jean Privat [Tue, 17 Jun 2014 20:03:06 +0000 (16:03 -0400)]
Merge: Include extra Java files in a project

Will be used to declare implement new Activities and sub classes like Listeners.

Pull-Request: #496
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 agopep8analysis: add copyright and doc to the pep8analysis_web module
Alexis Laferrière [Tue, 17 Jun 2014 18:52:21 +0000 (14:52 -0400)]
pep8analysis: add copyright and doc to the pep8analysis_web module

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

9 years agopep8analysis: add copyright info for viz.js
Alexis Laferrière [Tue, 17 Jun 2014 18:46:03 +0000 (14:46 -0400)]
pep8analysis: add copyright info for viz.js

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

9 years agotests: adds sav file for pep8analysis_web
Alexis Laferrière [Tue, 17 Jun 2014 18:28:55 +0000 (14:28 -0400)]
tests: adds sav file for pep8analysis_web

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

9 years agopep8analysis: improve initial loading speed
Alexis Laferrière [Mon, 16 Jun 2014 17:48:52 +0000 (13:48 -0400)]
pep8analysis: improve initial loading speed

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

9 years agopep8analysis: show annotated CFG in web interface
Alexis Laferrière [Mon, 16 Jun 2014 16:06:14 +0000 (12:06 -0400)]
pep8analysis: show annotated CFG in web interface

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

9 years agopep8analysis: add doc to web interface
Alexis Laferrière [Sun, 15 Jun 2014 18:00:17 +0000 (14:00 -0400)]
pep8analysis: add doc to web interface

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

9 years agopep8analysis: intro the web interface
Alexis Laferrière [Sun, 15 Jun 2014 13:54:37 +0000 (09:54 -0400)]
pep8analysis: intro the web interface

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

9 years agopep8analysis: intro a variant main program for a web interface
Alexis Laferrière [Sun, 15 Jun 2014 13:16:51 +0000 (09:16 -0400)]
pep8analysis: intro a variant main program for a web interface

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

9 years agopep8analysis: intro a feature to clear the list of errors/notes
Alexis Laferrière [Sun, 15 Jun 2014 13:29:54 +0000 (09:29 -0400)]
pep8analysis: intro a feature to clear the list of errors/notes

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

9 years agopep8analysis: print CFG as dot graph to OStream
Alexis Laferrière [Sun, 15 Jun 2014 13:28:40 +0000 (09:28 -0400)]
pep8analysis: print CFG as dot graph to OStream

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

9 years agopep8analysis: enable analyzing from stream
Alexis Laferrière [Sun, 15 Jun 2014 13:27:21 +0000 (09:27 -0400)]
pep8analysis: enable analyzing from stream

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

9 years agopep8analysis: fix format and encoding of some sample/test programs
Alexis Laferrière [Sun, 15 Jun 2014 13:21:07 +0000 (09:21 -0400)]
pep8analysis: fix format and encoding of some sample/test programs

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

9 years agolib: implement `close` in StringOStream
Alexis Laferrière [Mon, 16 Jun 2014 16:03:48 +0000 (12:03 -0400)]
lib: implement `close` in StringOStream

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

9 years agotests: add a test for the extra_java_files phase
Alexis Laferrière [Thu, 12 Jun 2014 13:14:12 +0000 (09:14 -0400)]
tests: add a test for the extra_java_files phase

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

9 years agoJava FFI: javac is always called on local files
Alexis Laferrière [Wed, 11 Jun 2014 20:11:56 +0000 (16:11 -0400)]
Java FFI: javac is always called on local files

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

9 years agoJava FFI: enable inserting additionnal Java files to a project
Alexis Laferrière [Wed, 11 Jun 2014 16:46:47 +0000 (12:46 -0400)]
Java FFI: enable inserting additionnal Java files to a project

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

9 years agoMerge: Compilation to JavaScript using the Emscripten SDK
Jean Privat [Tue, 17 Jun 2014 02:17:34 +0000 (22:17 -0400)]
Merge: Compilation to JavaScript using the Emscripten SDK

Published for review but still needs some doc and examples. Works with most small examples but not yet with the naive_interpreter (but it's not clear why).

Usage:

    apt-get emscripten
    nitg -m emscripten examples/hello_world.nit
    nodejs hello_wold.js

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

9 years agoemscipten_platform: do not use `append` on String
Jean Privat [Tue, 17 Jun 2014 15:09:40 +0000 (11:09 -0400)]
emscipten_platform: do not use `append` on String

It have not the right expected behavior.
Also it brings in Ropes and a lot of other crazy dependencies.

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

9 years agoMerge: Give top-level methods some rules
Jean Privat [Tue, 17 Jun 2014 01:14:04 +0000 (21:14 -0400)]
Merge: Give top-level methods some rules

1. explicit `self` is forbidden in top-level method
2. top-level methods can only be called without a explicit receiver

In the code, there is workarounds for 3 hard-coded special cases:
* `sys` and `exit`: because, for an unknown reason, intern method cannot be top-level. #493
* `args` because it is currently both in Sys and Object thus has a crazy status. #461

These rules are only enforced as it in `typing` but does not change the model, tools, or engines.

Note: the first commits fix a bug in the `for` where the implicit `iterator` method was resolved with the `recv_is_self` flag always set to true.

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

9 years agoMerge: Subtyping test with perfect hashing in the Nit vm
Jean Privat [Mon, 16 Jun 2014 17:30:16 +0000 (13:30 -0400)]
Merge: Subtyping test with perfect hashing in the Nit vm

This pull request contains the first files for the Nit virtual machine.

In this PR, the vm constructs runtime structures for each MClass of the model. These structures represent virtual tables for classes. When constructed, the virtual tables only reserve memory for method pointer but the method call is made with the naive_interpreter mechanisms.

The virtual machine can now performs subtyping test with the perfect hashing approach.

In the perfect_hashing module, numbering of items now start at 1 instead of 0.

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

9 years agotests: add tests for nitvm
Jean Privat [Fri, 13 Jun 2014 19:49:31 +0000 (15:49 -0400)]
tests: add tests for nitvm

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

9 years agoMerge: No duplicated mclassdefs
Jean Privat [Mon, 16 Jun 2014 22:42:43 +0000 (18:42 -0400)]
Merge: No duplicated mclassdefs

This series avoid the creation of multiple mclassdefs for a same class in a same module.

It appended for implicit classes: Object for top-level methods and Sys for top-level main.

The series was more complex than expected because it breaks the symmetry between AClassdef and MClassDef. However, thanks to the separation of the AST and the model, it was sill feasible.

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

9 years agoemscripten: add general features to lib
Alexis Laferrière [Sat, 14 Jun 2014 11:27:48 +0000 (07:27 -0400)]
emscripten: add general features to lib

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

9 years agoexamples: intro a README file to emscripten examples
Alexis Laferrière [Sat, 14 Jun 2014 11:28:23 +0000 (07:28 -0400)]
examples: intro a README file to emscripten examples

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

9 years agoexample: intro an emscripten wrapper around fibonacci
Alexis Laferrière [Sat, 14 Jun 2014 11:18:41 +0000 (07:18 -0400)]
example: intro an emscripten wrapper around fibonacci

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

9 years agoexample: intro an emscripten wrapper around hello world
Alexis Laferrière [Sat, 14 Jun 2014 10:00:19 +0000 (06:00 -0400)]
example: intro an emscripten wrapper around hello world

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

9 years agotests: support testing the emscripten module
Alexis Laferrière [Fri, 13 Jun 2014 22:20:04 +0000 (18:20 -0400)]
tests: support testing the emscripten module

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