nit.git
8 years agorta: no-op when AExpr::mtype or AExpr::cast_type is null
Jean Privat [Tue, 16 Jun 2015 13:30:17 +0000 (09:30 -0400)]
rta: no-op when AExpr::mtype or AExpr::cast_type is null

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

8 years agorta: new method `allocate_mtype` to factorize some code
Jean Privat [Tue, 16 Jun 2015 13:28:56 +0000 (09:28 -0400)]
rta: new method `allocate_mtype` to factorize some code

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

8 years agoMerge: A more POLA to_s on Collection
Jean Privat [Sun, 14 Jun 2015 01:10:09 +0000 (21:10 -0400)]
Merge: A more POLA to_s on Collection

As announced in #1385, this PR change the default `to_s` on collections.

Before: `[1, 2, 3].to_s == "123"`
After: `[1, 2, 3].to_s == "[1,2,3]"`

The main issue is for code that used `to_s` on array to get a fast concatenation.
Those should now use `plain_to_s` (or `join("")`).

Close #off-line issue signaled by @ablondin

Note: this PR fails on bootstrap (`to_s` is used internally) thus requires that `c_src` is regenerated.

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

8 years agoMerge: nitdoc: fix things, add more tests and benches
Jean Privat [Sat, 13 Jun 2015 11:21:01 +0000 (07:21 -0400)]
Merge: nitdoc: fix things, add more tests and benches

Two fixes:

* no more multiple instanciation of ToolContext (-25% of total nitdoc time)
* fixed JS scripts (no more bug with the search bar that does not display)

Testing:
* add more tests on pages structure
* add a script to build the documentation from origin/master version (easier to diff outputed doc after local changes)
* add a benchmark to nitdoc against the origin/master version

Performances comparison after fix on ToolContext:

![image](https://cloud.githubusercontent.com/assets/583144/8042382/e9feba6c-0dec-11e5-9bf9-0a3806209ee9.png)

(`CI-nitdoc` is busy right now on Jenkins so you will have to wait for the demo)

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

8 years agotests: update sav/nitdoc_args4.res after merge with master.
Jean Privat [Sat, 13 Jun 2015 11:20:26 +0000 (07:20 -0400)]
tests: update sav/nitdoc_args4.res after merge with 

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

8 years agoMerge master to solve conflicts
Jean Privat [Sat, 13 Jun 2015 11:20:21 +0000 (07:20 -0400)]
Merge master to solve conflicts

8 years agotests: update with new `to_s` on collections
Jean Privat [Sun, 24 May 2015 02:40:53 +0000 (22:40 -0400)]
tests: update with new `to_s` on collections

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

8 years agolib/json: update nitunits with new Collection::to_s behavior
Jean Privat [Sat, 13 Jun 2015 03:39:59 +0000 (23:39 -0400)]
lib/json: update nitunits with new Collection::to_s behavior

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

8 years agolib/standard: add nitunits to Collection::plain_to_s
Jean Privat [Mon, 1 Jun 2015 14:09:59 +0000 (10:09 -0400)]
lib/standard: add nitunits to Collection::plain_to_s

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

8 years agolib/standand/string: provides a better to_s for collections
Jean Privat [Sun, 24 May 2015 02:40:31 +0000 (22:40 -0400)]
lib/standand/string: provides a better to_s for collections

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

8 years agolib/opts: clients of `errors` use `join("\n")`
Jean Privat [Sun, 31 May 2015 02:50:56 +0000 (22:50 -0400)]
lib/opts: clients of `errors` use `join("\n")`

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

8 years agolib/standard: format use `plain_to_s` for fast concat
Jean Privat [Sat, 13 Jun 2015 03:39:00 +0000 (23:39 -0400)]
lib/standard: format use `plain_to_s` for fast concat

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

8 years agolib/standard: StringWriter use `plain_to_s` for fast concat
Jean Privat [Sun, 31 May 2015 02:50:06 +0000 (22:50 -0400)]
lib/standard: StringWriter use `plain_to_s` for fast concat

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

8 years agolib_standard_array: reprovide Array::plain_to_s
Jean Privat [Sat, 13 Jun 2015 00:15:40 +0000 (20:15 -0400)]
lib_standard_array: reprovide Array::plain_to_s

Was dropped by the merge of #1400

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

8 years agoMerge: friendz with Android Audio API
Jean Privat [Fri, 12 Jun 2015 19:15:28 +0000 (15:15 -0400)]
Merge: friendz with Android Audio API

friendz now uses the Android Audio API
+ fixed the new_global_ref functions in Assets and Resources

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

8 years agoMerge: String split
Jean Privat [Fri, 12 Jun 2015 17:17:39 +0000 (13:17 -0400)]
Merge: String split

Right now, the string module is over 2500 loc long.

For the mental health of the maintainer(s), it was getting too big to understand what was going on in it.

So, this PR introduces the text group in standard, string is split in several modules inside of it:

* native: Introduces NativeString
* abstract_text: Introduction of basic types
* flat: Any array-based string
* ropes: Rope-based strings

Big con: To merge this PR, bootstrap will need to support the nullable arguments syntax.

But in the meantime, please feel free to comment on the code

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

8 years agoMerge: lib/array: remove useless cast to comparable.
Jean Privat [Fri, 12 Jun 2015 17:17:35 +0000 (13:17 -0400)]
Merge: lib/array: remove useless cast to comparable.

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

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

8 years agoMerge: Kill dead nitg
Jean Privat [Fri, 12 Jun 2015 17:17:10 +0000 (13:17 -0400)]
Merge: Kill dead nitg

Remove all remaining deprecated reference to `nitg`.

The renaming of `nitg` to `nitc` and the deprecation of `nitg` was done Wed Dec 10 so 6 month ago. cf #1000

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

8 years agoMerge: Regeneration of c_src
Jean Privat [Fri, 12 Jun 2015 17:16:10 +0000 (13:16 -0400)]
Merge: Regeneration of c_src

Last one was Fri Feb 6, four months ago.

Close #1426

Pull-Request: #1455
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: ArthurDelamare <arthur.delamare@viacesi.fr>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>

8 years agoregern c_src
Jean Privat [Wed, 10 Jun 2015 13:14:37 +0000 (09:14 -0400)]
regern c_src

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

8 years agomakefile: create ../bin is required
Jean Privat [Fri, 12 Jun 2015 10:33:27 +0000 (06:33 -0400)]
makefile: create ../bin is required

because the dir is now empty, it starts uncreated on the initial git clone

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

8 years agoMerge: Kill big vararg in parser
Jean Privat [Fri, 12 Jun 2015 02:36:55 +0000 (22:36 -0400)]
Merge: Kill big vararg in parser

In `parser::Parser::build_reduce_table` an array is allocated with `.with_items` that takes a vararg.

The vararg used is quite large (1116 elements) and this cause that the generated C code takes 30m to compile with clang-3.6 if -O2 is used; it is likely a regression in llvm since the same code takes appreciatively 1s with clang-3.5 (and with gcc).

Unfortunately, clang-3.6 is currently provided by Apple to MacOS X users.

The proposed solution is to allocate the array then use a sequence of `add`. The generated C code is more complex but clang-3.6 can compile it.

Close #1498 (once c_src is regenerated)

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

8 years agoMerge: compiler: NativeString is a char* to please C library.
Jean Privat [Fri, 12 Jun 2015 02:36:48 +0000 (22:36 -0400)]
Merge: compiler: NativeString is a char* to please C library.

Commit 6b52ea3d5ca77dbcc6edbbf71c1aa9419a019bac  on chars and string changed the ctype of NativeString to `unsigned char*`. This was the cause of C warnings `-Wpointer-sign` because `unsigned char*` is not a subtype of the universally used `char*` that is activated by default on clang.

So the change is reverted and NativeString become again `char*` (note that Byte and Char ctypes are not reverted)

close #1499

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

8 years agoMerge: example: add boolean usage example from rosetta code
Jean Privat [Fri, 12 Jun 2015 02:36:42 +0000 (22:36 -0400)]
Merge: example: add boolean usage example from rosetta code

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

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

8 years agoman: update title of nitc to `NITC`
Jean Privat [Fri, 12 Jun 2015 03:14:26 +0000 (23:14 -0400)]
man: update title of nitc to `NITC`

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

8 years agoc_src: rename the primitive compiler to `c_src/nitc` everywhere
Jean Privat [Fri, 12 Jun 2015 03:13:01 +0000 (23:13 -0400)]
c_src: rename the primitive compiler to `c_src/nitc` everywhere

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

8 years agonittester: use new compiler engine names (`nitc*`)
Jean Privat [Fri, 12 Jun 2015 03:08:41 +0000 (23:08 -0400)]
nittester: use new compiler engine names (`nitc*`)

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

8 years agotests: rename compiler engines with `nitc*`, not `nitg*`
Jean Privat [Fri, 12 Jun 2015 03:05:41 +0000 (23:05 -0400)]
tests: rename compiler engines with `nitc*`, not `nitg*`

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

8 years agobin: remove old transitionnal script bin/nitg
Jean Privat [Fri, 12 Jun 2015 02:56:23 +0000 (22:56 -0400)]
bin: remove old transitionnal script bin/nitg

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

8 years agotests: use `nitc` in the `nitc.args`
Jean Privat [Fri, 12 Jun 2015 02:54:29 +0000 (22:54 -0400)]
tests: use `nitc` in the `nitc.args`

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

8 years agomisc/bash_completion: remove hack for nitg
Jean Privat [Fri, 12 Jun 2015 02:53:58 +0000 (22:53 -0400)]
misc/bash_completion: remove hack for nitg

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

8 years agolib/emscripten: talk about `nitc` (not `nitg`)
Jean Privat [Fri, 12 Jun 2015 02:53:31 +0000 (22:53 -0400)]
lib/emscripten: talk about `nitc` (not `nitg`)

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

8 years agovim: rename `nitg` checker to `nitpick`
Jean Privat [Fri, 12 Jun 2015 02:48:46 +0000 (22:48 -0400)]
vim: rename `nitg` checker to `nitpick`

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

8 years agoremove bin/Makefile (?!)
Jean Privat [Fri, 12 Jun 2015 02:42:54 +0000 (22:42 -0400)]
remove bin/Makefile (?!)

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

8 years agoMerge: nitunit: use the Markdown parser from `lib/markdown`
Jean Privat [Fri, 12 Jun 2015 02:36:11 +0000 (22:36 -0400)]
Merge: nitunit: use the Markdown parser from `lib/markdown`

Since the introduction of `nitmd`, `nitunit` was still using the old `docdown` parser.
This PR do the migration.

There will be a lot of unrecognized tests since the old paerser allowed between four and five spaces before a nitunit, the new one enforce the rule of 5 (couting the space after the `#` comment token).

Before:
~~~nit
#    assert true
~~~
Was recognized as nitunit, but if you ignore the `# ` string as prefix of each comment, there is only 3 spaces before the nitunit.

After:
~~~nit
#     assert true
~~~
We need 4 spaces before the nitunit plus the `# ` prefix, this gives us 5 spaces.

Note, this is already the behavior followed by Nitdoc.

Should fix #1331

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

8 years agoMerge: nitrpg: remove points if a PR is closed without merge
Jean Privat [Thu, 11 Jun 2015 21:44:52 +0000 (17:44 -0400)]
Merge: nitrpg: remove points if a PR is closed without merge

So @ventilooo won't cheat again!

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

Pull-Request: #1477
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: ArthurDelamare <arthur.delamare@viacesi.fr>

8 years agoMerge: rosetta_code: sha1
Jean Privat [Thu, 11 Jun 2015 21:44:47 +0000 (17:44 -0400)]
Merge: rosetta_code: sha1

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

Pull-Request: #1456
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: ArthurDelamare <arthur.delamare@viacesi.fr>

8 years agoMerge: Nitiwiki next
Jean Privat [Thu, 11 Jun 2015 20:24:10 +0000 (16:24 -0400)]
Merge: Nitiwiki next

Some fixes for nitiwiki in prevision for the nitlanguage.org site migration and the resolution of #824.

Do not consider b481cea since it belongs to #1368 (and break the loader)

Feature summary:
* ini accept array notation
* customizable sidebar content
* customizable sidebar position
* wikilinks support external links
* better search by title
* better search by path
* make breadcrumbs and summaries optionnal
* add link to github for last_changes and edit mode

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

8 years agoparser: regen parser.nit without the big vararg
Jean Privat [Thu, 11 Jun 2015 19:44:18 +0000 (15:44 -0400)]
parser: regen parser.nit without the big vararg

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

8 years agoparser: `build_reduce_table` uses a sequence of add instead of a `.with_items`
Jean Privat [Thu, 11 Jun 2015 19:43:33 +0000 (15:43 -0400)]
parser: `build_reduce_table` uses a sequence of add instead of a `.with_items`

The big vararg generated produce C code that takes 30m to compile with
clang-3.6 because of a regression (the same code takes less than 1s with
clang-3.5).

Unfortunately, clang-3.6 is currently provided by Apple to MacOS X users.

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

8 years agomisc: add build_origin_doc to easily build reference document from master
Alexandre Terrasa [Tue, 9 Jun 2015 03:27:57 +0000 (23:27 -0400)]
misc: add build_origin_doc to easily build reference document from master

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

8 years agobenchmarks: add nitdoc benches
Alexandre Terrasa [Sun, 7 Jun 2015 22:44:42 +0000 (18:44 -0400)]
benchmarks: add nitdoc benches

Used to compare prefs between HEAD version and origin/master version

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

8 years agonitdoc: test pages structure
Alexandre Terrasa [Thu, 11 Jun 2015 02:51:16 +0000 (22:51 -0400)]
nitdoc: test pages structure

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

8 years agocompiler: NativeString is a char* to please C library.
Jean Privat [Thu, 11 Jun 2015 17:15:07 +0000 (13:15 -0400)]
compiler: NativeString is a char* to please C library.

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

8 years agonitdoc: better pretty-printing
Alexandre Terrasa [Thu, 11 Jun 2015 02:50:32 +0000 (22:50 -0400)]
nitdoc: better pretty-printing

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

8 years agobenchmarks: add benches for nitunit
Alexandre Terrasa [Wed, 10 Jun 2015 05:43:56 +0000 (01:43 -0400)]
benchmarks: add benches for nitunit

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

8 years agolib: fix whitespaces in misc files
Alexandre Terrasa [Wed, 13 May 2015 23:48:56 +0000 (19:48 -0400)]
lib: fix whitespaces in misc files

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

8 years agolib: fix nitunits indentation
Alexandre Terrasa [Wed, 13 May 2015 23:48:10 +0000 (19:48 -0400)]
lib: fix nitunits indentation

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

8 years agolib: fix nitish in nitunits
Alexandre Terrasa [Wed, 13 May 2015 23:45:16 +0000 (19:45 -0400)]
lib: fix nitish in nitunits

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

8 years agosrc: remove unused docdown parser and test
Alexandre Terrasa [Mon, 11 May 2015 16:37:42 +0000 (12:37 -0400)]
src: remove unused docdown parser and test

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

8 years agonitunit: update tests
Alexandre Terrasa [Mon, 11 May 2015 17:42:58 +0000 (13:42 -0400)]
nitunit: update tests

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

8 years agonitunit: use the Markdown parser from `lib/markdown` instead of `src/docdown`
Alexandre Terrasa [Mon, 25 May 2015 16:54:23 +0000 (12:54 -0400)]
nitunit: use the Markdown parser from `lib/markdown` instead of `src/docdown`

Fixes #1331

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

8 years agolib/markdown: fix multiple fence in the same comment
Alexandre Terrasa [Mon, 11 May 2015 17:31:26 +0000 (13:31 -0400)]
lib/markdown: fix multiple fence in the same comment

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

8 years agoexample: add boolean usage example from rosetta code
Alexandre Terrasa [Wed, 10 Jun 2015 19:37:22 +0000 (15:37 -0400)]
example: add boolean usage example from rosetta code

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

8 years agonitrpg: remove points if a PR is closed without merge
Alexandre Terrasa [Wed, 10 Jun 2015 17:52:17 +0000 (13:52 -0400)]
nitrpg: remove points if a PR is closed without merge

So @ventilooo won't cheat again!

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

8 years agorosetta_code: sha1
Jean Privat [Wed, 10 Jun 2015 14:29:07 +0000 (10:29 -0400)]
rosetta_code: sha1

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

8 years agoMerge: Activate C warnings in FFI code and revert `NativeString` to `char *`
Jean Privat [Wed, 10 Jun 2015 01:47:19 +0000 (21:47 -0400)]
Merge: Activate C warnings in FFI code and revert `NativeString` to `char *`

The revert commit is partial, it affects only NativeString and does not touch Char.

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

8 years agoMerge: Work on the Curl module
Jean Privat [Wed, 10 Jun 2015 01:47:05 +0000 (21:47 -0400)]
Merge: Work on the Curl module

Changes:
* Simplify callbacks so they do not break light FFI only engines.
* Remove about 8 classes and 3 C structures.
* Remove the custom implementation of NativeFile.
* Update style to the latest best practices. Note that it was one of the first large module based on the FFI, a lot has changed since then.
* Revamp and rename CurlMail, its API is now nicer to use:
~~~
import curl

var mail = new CurlMail("sender@example.org", ["to@example.org"], cc=["bob@example.org"])

mail.subject = "Hello From My Nit Program"
mail.body = "<h1>Here you can write HTML stuff.</h1>"

mail.headers_body["Content-Type:"] = """text/html; charset="UTF-8""""
mail.headers_body["Content-Transfer-Encoding:"] = "quoted-printable"

# Set mail server
var error = mail.set_outgoing_server("smtps://smtp.example.org:465", "user@example.org", "mypassword")
assert error == null

# Send
error = mail.execute
assert error == null
~~~

Thoughts on what's to do next:

* Extract the request API so Curl is only an implementation. The abstract API could also be implemented on Android where we can use Java services instead.
* Clean up `CurlHTTPRequest`.
* Use `Error` and differentiate between internal Curl errors and normal transfert failures.
* Replace the C structure linked to reading data and add tests for its usage.
* Add dead simple services: `Text::download: nullable String`, `Text::download_to_file(filepath: Text)`, `Text::download_to_stream(stream: Writer)` or something like that.
* Make more classes of native_curl private as we cannot make the module private because it defines the user-customizable callbacks. Some modules (neo4j) use what would be private, so it requires updating them also.

---

Should fix #936 and other problems when importing but not using Curl.
Also helps #1443 correctly report unsupported programs.

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

8 years agoMerge: Add some collections for java/collections.nit
Jean Privat [Wed, 10 Jun 2015 01:46:52 +0000 (21:46 -0400)]
Merge: Add some collections for java/collections.nit

This PR complete the java collections : ``` int[], short[], long[], boolean[], byte[], char[] ```

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

8 years agoMerge: Attribute and autoinit annotations
Jean Privat [Wed, 10 Jun 2015 01:46:42 +0000 (21:46 -0400)]
Merge: Attribute and autoinit annotations

A big set of loosely coupled but related changed on the annotations on attributes and methods.
Here is a summary of the changes on the user-side:

* No more special case for the kind of classes, so you can use `autoinit` in interfaces.
* Explicit annotation `autoinit` is understood on attributes and is the default on value-less concrete attribute.
* Abstract attributes are `noautoinit` by default, if `autoinit` is given, it is applied on the setter. This way abstract attributes are basically just a couple of getter-setter. close #1311

This way there is less special cases and behaviors. Still more work is required to finish #1322.

Pull-Request: #1433
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: nitvm: Basic blocks generation and SSA-algorithm
Jean Privat [Wed, 10 Jun 2015 01:46:34 +0000 (21:46 -0400)]
Merge: nitvm: Basic blocks generation and SSA-algorithm

This PR introduces a SSA-algorithm implementation in the nitvm.

First, basic blocks are generated. A basic block is a sequence of instructions without a jump inside.
In this version, basic blocks are generated from the AST and so they contain only the first instruction and the last one.

Then, SSA-algorithm (Single-Static Assignment) is implemented. In SSA algorithm, variables are renamed to have only one assignment per variable.
Each time an assignment is made, a new version of a variable is made.

Some variables (phi-functions) have several assignment and so, several dependances.

The basic block generation and SSA are computed for each method in a lazy way in the nitvm.
The main objective of SSA is to give the dependances for each variable (this will be used in further PR).
This module also collect all object-mechanisms sites during the visit of methods.

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

8 years agoMerge: example: add 24 game task of Rosetta code
Jean Privat [Wed, 10 Jun 2015 01:46:20 +0000 (21:46 -0400)]
Merge: example: add 24 game task of Rosetta code

Rosetta code example of 24 game
<http://rosettacode.org/wiki/24_game>

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

8 years agoMerge: file: fix `simplify_path` behavior for path starting with `.`.
Jean Privat [Wed, 10 Jun 2015 01:46:14 +0000 (21:46 -0400)]
Merge: file: fix `simplify_path` behavior for path starting with `.`.

Before this PR `./` was simplified in `/` which was wrong.

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

Pull-Request: #1368
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Date Lib
Jean Privat [Wed, 10 Jun 2015 01:46:08 +0000 (21:46 -0400)]
Merge: Date Lib

les fonctions ce trouve dans le module date_f.nit.

Pull-Request: #1100
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>

8 years agolib/markdown: fix missing space after wikilinks token
Alexandre Terrasa [Sat, 6 Jun 2015 20:47:01 +0000 (16:47 -0400)]
lib/markdown: fix missing space after wikilinks token

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

8 years agonitiwiki: add github url for last changes and edit mode
Alexandre Terrasa [Sat, 6 Jun 2015 20:09:31 +0000 (16:09 -0400)]
nitiwiki: add github url for last changes and edit mode

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

8 years agonitiwiki: also search relative patch in current section
Alexandre Terrasa [Sat, 6 Jun 2015 20:09:05 +0000 (16:09 -0400)]
nitiwiki: also search relative patch in current section

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

8 years agonitiwiki: search titles in lower case
Alexandre Terrasa [Sat, 6 Jun 2015 20:08:19 +0000 (16:08 -0400)]
nitiwiki: search titles in lower case

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

8 years agonitiwiki: make breadcrumbs optional
Alexandre Terrasa [Sat, 6 Jun 2015 19:10:06 +0000 (15:10 -0400)]
nitiwiki: make breadcrumbs optional

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

8 years agonitiwiki: make summary optional
Alexandre Terrasa [Sat, 6 Jun 2015 19:09:45 +0000 (15:09 -0400)]
nitiwiki: make summary optional

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

8 years agonitiwiki: allow absolute url in wikilinks
Alexandre Terrasa [Sat, 6 Jun 2015 18:55:54 +0000 (14:55 -0400)]
nitiwiki: allow absolute url in wikilinks

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

8 years agonitiwiki: introduce customizable sidebar
Alexandre Terrasa [Tue, 2 Jun 2015 04:47:02 +0000 (00:47 -0400)]
nitiwiki: introduce customizable sidebar

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

8 years agonitiwiki: make all wiki entries able to parse markdown
Alexandre Terrasa [Tue, 2 Jun 2015 04:46:42 +0000 (00:46 -0400)]
nitiwiki: make all wiki entries able to parse markdown

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

8 years agonitiwiki: fix link lookup on root
Alexandre Terrasa [Tue, 2 Jun 2015 04:45:25 +0000 (00:45 -0400)]
nitiwiki: fix link lookup on root

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

8 years agoini: accept array notation
Alexandre Terrasa [Tue, 2 Jun 2015 03:26:12 +0000 (23:26 -0400)]
ini: accept array notation

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

8 years agoini: show error instead crashing on bad formatting
Alexandre Terrasa [Tue, 2 Jun 2015 03:05:09 +0000 (23:05 -0400)]
ini: show error instead crashing on bad formatting

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

8 years agonitiwiki: change position of sidebar from config
Alexandre Terrasa [Tue, 2 Jun 2015 02:50:59 +0000 (22:50 -0400)]
nitiwiki: change position of sidebar from config

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

8 years agonitvm: Using SSA module in the nitvm
Julien Pagès [Wed, 3 Jun 2015 18:35:06 +0000 (20:35 +0200)]
nitvm: Using SSA module in the nitvm

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

8 years agonitvm: A method compile offers a unique entry point for compilation-like mechanisms
Julien Pagès [Fri, 29 May 2015 13:57:53 +0000 (15:57 +0200)]
nitvm: A method compile offers a unique entry point for compilation-like mechanisms

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

8 years agonitdoc: remove `require.js` dependency
Alexandre Terrasa [Sat, 6 Jun 2015 23:59:02 +0000 (19:59 -0400)]
nitdoc: remove `require.js` dependency

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

8 years agofile: fix `simplify_path` behavior for path starting with `.`.
Alexandre Terrasa [Tue, 9 Jun 2015 17:20:34 +0000 (13:20 -0400)]
file: fix `simplify_path` behavior for path starting with `.`.

Before this PR `./` was simplified as `/` which is wrong.

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

8 years agolib: fix C compiler warnings in sha1, socket and sdl
Alexis Laferrière [Tue, 9 Jun 2015 15:24:32 +0000 (11:24 -0400)]
lib: fix C compiler warnings in sha1, socket and sdl

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

8 years agolib: fix C compiler warnings in standard library
Alexis Laferrière [Tue, 9 Jun 2015 15:24:20 +0000 (11:24 -0400)]
lib: fix C compiler warnings in standard library

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

8 years agoPartial Revert "compiler: Changed types of Char to uint32_t and NativeString to unsig...
Alexis Laferrière [Tue, 9 Jun 2015 14:57:00 +0000 (10:57 -0400)]
Partial Revert "compiler: Changed types of Char to uint32_t and NativeString to unsigned char*"

This reverts commit 6b52ea3d5ca77dbcc6edbbf71c1aa9419a019bac.

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

8 years agosrc: compile user C code with -Wall
Alexis Laferrière [Tue, 9 Jun 2015 14:55:59 +0000 (10:55 -0400)]
src: compile user C code with -Wall

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

8 years agoexample/simple update sounds test
BlackMinou [Wed, 3 Jun 2015 11:13:40 +0000 (13:13 +0200)]
example/simple update sounds test

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agocontrib/friendz: update so it uses android sound library
BlackMinou [Wed, 3 Jun 2015 11:11:33 +0000 (13:11 +0200)]
contrib/friendz: update so it uses android sound library

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoandroid assets and resources update
BlackMinou [Wed, 3 Jun 2015 11:01:21 +0000 (13:01 +0200)]
android assets and resources update

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoandroid audio : update with error management
BlackMinou [Wed, 3 Jun 2015 10:57:02 +0000 (12:57 +0200)]
android audio : update with error management

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agotests: add base_attr_annot.nit
Jean Privat [Wed, 3 Jun 2015 15:23:39 +0000 (11:23 -0400)]
tests: add base_attr_annot.nit

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

8 years agotests: add base_attr_abstract[34].nit
Jean Privat [Wed, 3 Jun 2015 14:24:41 +0000 (10:24 -0400)]
tests: add base_attr_abstract[34].nit

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

8 years agotests: update other tests related to init with setters
Jean Privat [Wed, 27 May 2015 15:21:49 +0000 (11:21 -0400)]
tests: update other tests related to init with setters

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

8 years agotests: add base_init_setter.nit
Jean Privat [Wed, 27 May 2015 15:31:45 +0000 (11:31 -0400)]
tests: add base_init_setter.nit

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

8 years agotests: update base_attr_abstract[12].nit
Jean Privat [Wed, 27 May 2015 15:21:01 +0000 (11:21 -0400)]
tests: update base_attr_abstract[12].nit

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

8 years agomodelize: remove restriction on concrete class in intializer collect
Jean Privat [Wed, 3 Jun 2015 15:24:55 +0000 (11:24 -0400)]
modelize: remove restriction on concrete class in intializer collect

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

8 years agomodelize: error/warning if explicit autoinit on attributes
Jean Privat [Wed, 3 Jun 2015 14:04:55 +0000 (10:04 -0400)]
modelize: error/warning if explicit autoinit on attributes

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

8 years agomodelize: error in `autoinit` is used in class refinement
Jean Privat [Fri, 29 May 2015 16:05:42 +0000 (12:05 -0400)]
modelize: error in `autoinit` is used in class refinement

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

8 years agomodelize: move `autoinit` management on method into AMethPropdef
Jean Privat [Fri, 29 May 2015 16:05:17 +0000 (12:05 -0400)]
modelize: move `autoinit` management on method into AMethPropdef

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

8 years agomodelize: rely on `AAttrPropdef::mreadpropdef` to be the main property
Jean Privat [Wed, 27 May 2015 13:28:06 +0000 (09:28 -0400)]
modelize: rely on `AAttrPropdef::mreadpropdef` to be the main property

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

8 years agomodelize: add `AAttrPropdef::mtype` to factorize the type access
Jean Privat [Wed, 27 May 2015 13:27:12 +0000 (09:27 -0400)]
modelize: add `AAttrPropdef::mtype` to factorize the type access

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