nit.git
8 years agonitvm: Generation of basic blocks from an AST
Julien Pagès [Mon, 1 Jun 2015 13:13:46 +0000 (15:13 +0200)]
nitvm: Generation of basic blocks from an AST

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

8 years agonitvm: Class Basic block for preparing SSA
Julien Pagès [Mon, 1 Jun 2015 10:27:30 +0000 (12:27 +0200)]
nitvm: Class Basic block for preparing SSA

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

8 years agoexample: add 24 game task of Rosetta code
Arthur Delamare [Thu, 21 May 2015 19:35:08 +0000 (15:35 -0400)]
example: add 24 game task of Rosetta code

Signed-off-by: Arthur Delamare <arthur.delamare@viacesi.fr>

8 years agoAdd some collections for java/collections.nit
Mehdi [Wed, 3 Jun 2015 18:12:23 +0000 (14:12 -0400)]
Add some collections for java/collections.nit

Signed-off-by: Mehdi <overpex@gmail.com>

8 years agoMerge: Opportunity: Adds total number of participants to a meetup
Jean Privat [Thu, 4 Jun 2015 10:35:16 +0000 (06:35 -0400)]
Merge: Opportunity: Adds total number of participants to a meetup

As requested in #1431, this PR adds the total number of participants in a Meetup, as a number aside from the Total, like:

`Total(nb)`

Closes #1431

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

8 years agoMerge: Floats in exponent notation
Jean Privat [Thu, 4 Jun 2015 10:35:10 +0000 (06:35 -0400)]
Merge: Floats in exponent notation

As a new addition to the parser, as requested in #1261, literal floating-point values in exponent notation.

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

8 years agoMerge: Portable stack-traces
Jean Privat [Thu, 4 Jun 2015 10:34:57 +0000 (06:34 -0400)]
Merge: Portable stack-traces

Most detection of the availability of libunwind and the flags to use is moved at the C compilation time (in the Makefile) instead at the Nit compilation time.

Moreover, if libunwind is not available, then stacktraces are just disabled (instead of aborting).

Another advantage is that the generated C is more portable and can be compiled in a different system.
Thus, this will help cross-compilation and should even enable the bootstrap on libunwind-less system like raspberrypi once c_src is regenerated (cf #1149).

The option `--stacktrace` is also replaced with a simpler `--no-stacktrace` for people that want to disable it completely at C-compile time.

Close #1357 and an item in #864.

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

8 years agoMerge: Loose Tokens
Jean Privat [Thu, 4 Jun 2015 10:34:34 +0000 (06:34 -0400)]
Merge: Loose Tokens

Another step to simplify the clients of AST: loose tokens.

Some tokens, correctly lexed by the lexer, are discarded by the parser because of (thanks to?) sablecc transformations. Mainly comments and new-lines (EOL) are lost but some other tokens might be also discarded (currently, commas and dots are still lost).

Previously, the full sequence of tokens can still be accessed trough `next_token` and `prev_token` but this mean that tools like nitprettty and nitlight have to maintain two cursors, one on the AST and one on this linked list of tokens and try to keep these two cursors synchronized.

This PR names the concept of *loose* tokens that are lexed tokens but absent from the AST, and attach to each (non-loose) token in the AST a list of loose tokens that precede it (`prev_looses`) and that follow it (`next_looses`).
This way, a visit on the AST can be used to also easily process all the tokens from the source.

Future PRs will try to use this new thing to improve/simplify/whatever nitpretty and nitlight.

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

8 years agomksrc: remove --stacktrace
Jean Privat [Thu, 4 Jun 2015 10:34:02 +0000 (06:34 -0400)]
mksrc: remove --stacktrace

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

8 years agotests: update error message when module not found
Jean Privat [Thu, 4 Jun 2015 00:58:25 +0000 (20:58 -0400)]
tests: update error message when module not found

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

8 years agotests: add base_do_block.nit
Jean Privat [Wed, 3 Jun 2015 23:40:14 +0000 (19:40 -0400)]
tests: add base_do_block.nit

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

8 years agofrontend: warn useless `do` blocks
Jean Privat [Wed, 3 Jun 2015 23:39:48 +0000 (19:39 -0400)]
frontend: warn useless `do` blocks

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

8 years agoloader: teach it to search in src subdirectories
Jean Privat [Wed, 3 Jun 2015 18:47:48 +0000 (14:47 -0400)]
loader: teach it to search in src subdirectories

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

8 years agoloader: add contrib to the default path of projects
Jean Privat [Wed, 3 Jun 2015 18:26:12 +0000 (14:26 -0400)]
loader: add contrib to the default path of projects

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

8 years agoloader: use join_path to search the lib directory
Jean Privat [Wed, 3 Jun 2015 18:25:39 +0000 (14:25 -0400)]
loader: use join_path to search the lib directory

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

8 years agoparser: ComputeProdLocationVisitor also compute *_looses tokens
Jean Privat [Wed, 3 Jun 2015 00:42:03 +0000 (20:42 -0400)]
parser: ComputeProdLocationVisitor also compute *_looses tokens

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

8 years agoparser: the parent of EOF is Start
Jean Privat [Wed, 3 Jun 2015 00:41:13 +0000 (20:41 -0400)]
parser: the parent of EOF is Start

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

8 years agoparser: ComputeProdLocationVisitor remember the last token instead of the location
Jean Privat [Thu, 14 May 2015 23:18:15 +0000 (19:18 -0400)]
parser: ComputeProdLocationVisitor remember the last token instead of the location

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

8 years agoparser: add `is_loose`, `prev_looses` and `next_looses`
Jean Privat [Thu, 14 May 2015 23:17:11 +0000 (19:17 -0400)]
parser: add `is_loose`, `prev_looses` and `next_looses`

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

fixup loos in nodes

8 years agotests: Updated test_float for new literals
Lucas Bajolet [Wed, 3 Jun 2015 15:38:50 +0000 (11:38 -0400)]
tests: Updated test_float for new literals

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

8 years agoparser: Regenerated for new floats
Lucas Bajolet [Wed, 3 Jun 2015 15:37:41 +0000 (11:37 -0400)]
parser: Regenerated for new floats

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

8 years agoparser: Updated to support float with exponent part
Lucas Bajolet [Wed, 3 Jun 2015 15:37:24 +0000 (11:37 -0400)]
parser: Updated to support float with exponent part

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

8 years agoOpportunity: Adds total number of participants to a meetup
Lucas Bajolet [Wed, 3 Jun 2015 15:28:48 +0000 (11:28 -0400)]
Opportunity: Adds total number of participants to a meetup

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

8 years agoMerge: Manage errors on reading binary data
Jean Privat [Wed, 3 Jun 2015 02:00:06 +0000 (22:00 -0400)]
Merge: Manage errors on reading binary data

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

8 years agoMerge: Better error handling in Socket
Jean Privat [Wed, 3 Jun 2015 02:00:01 +0000 (22:00 -0400)]
Merge: Better error handling in Socket

Errors on both finding a host by its name and on connection are reported with all available details as an `Error`.

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

8 years agoMerge: Fix for Android
Jean Privat [Wed, 3 Jun 2015 01:58:38 +0000 (21:58 -0400)]
Merge: Fix for Android

Pull-Request: #1429
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: Native Types
Jean Privat [Wed, 3 Jun 2015 01:58:32 +0000 (21:58 -0400)]
Merge: Native Types

Since we plan on conforming with UTF-8, chars can no longer be of C char type, this PR changes the internal representation of a Char to become capable of holding an arbitrary Unicode code point.

Since chars become unsigned entities, and since NativeString will hold Byte values soon, its c type has been changed to unsigned char* as preparation for the migration

This is all related and necessary for #1262.

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

8 years agoman: document `--no-stacktrace` and `NIT_NO_STACK` in nitc.1
Jean Privat [Wed, 3 Jun 2015 01:54:14 +0000 (21:54 -0400)]
man: document `--no-stacktrace` and `NIT_NO_STACK` in nitc.1

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

8 years agocompiler: replace the option `--stacktrace` with a simpler `--no-stacktrace`
Jean Privat [Wed, 3 Jun 2015 01:31:29 +0000 (21:31 -0400)]
compiler: replace the option `--stacktrace` with a simpler `--no-stacktrace`

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

8 years agocompiler: protect the stacktrace-aware C code with the preprocessor
Jean Privat [Wed, 3 Jun 2015 01:30:45 +0000 (21:30 -0400)]
compiler: protect the stacktrace-aware C code with the preprocessor

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

8 years agocompiler: generate C stacktrace-awareness iff the platform supports it
Jean Privat [Wed, 3 Jun 2015 01:28:41 +0000 (21:28 -0400)]
compiler: generate C stacktrace-awareness iff the platform supports it

Do not rely on the option `--stacktrace`,
so that the decision to uhave them could be deported at the C compile-time

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

8 years agolib/binary: document behavior when reading binary data with a pending error
Alexis Laferrière [Tue, 2 Jun 2015 15:32:10 +0000 (11:32 -0400)]
lib/binary: document behavior when reading binary data with a pending error

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

8 years agolib/binary: protect `read_string` from stream errors
Alexis Laferrière [Mon, 1 Jun 2015 13:05:06 +0000 (09:05 -0400)]
lib/binary: protect `read_string` from stream errors

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

8 years agolib/binary: redirect 32 bits endianess functions on Android
Alexis Laferrière [Sat, 30 May 2015 17:46:37 +0000 (13:46 -0400)]
lib/binary: redirect 32 bits endianess functions on Android

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

8 years agolib/mnit_android: fix `Int::next_pow`
Alexis Laferrière [Sat, 30 May 2015 17:45:42 +0000 (13:45 -0400)]
lib/mnit_android: fix `Int::next_pow`

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

8 years agolib/socket: set `last_error` on connection failed
Alexis Laferrière [Tue, 2 Jun 2015 15:03:21 +0000 (11:03 -0400)]
lib/socket: set `last_error` on connection failed

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

8 years agolib/socket: set `last_error` on failed hostname lookups
Alexis Laferrière [Tue, 2 Jun 2015 11:33:04 +0000 (07:33 -0400)]
lib/socket: set `last_error` on failed hostname lookups

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

8 years agolib/socket: intro `HErrno::to_s`
Alexis Laferrière [Tue, 2 Jun 2015 15:01:17 +0000 (11:01 -0400)]
lib/socket: intro `HErrno::to_s`

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

8 years agolib/socket: wrap h_errno to report error on gethostbyname
Alexis Laferrière [Tue, 2 Jun 2015 12:44:33 +0000 (08:44 -0400)]
lib/socket: wrap h_errno to report error on gethostbyname

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

8 years agolib/socket: move gethostbyname to Sys and use light FFI
Alexis Laferrière [Tue, 2 Jun 2015 12:44:01 +0000 (08:44 -0400)]
lib/socket: move gethostbyname to Sys and use light FFI

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

8 years agocompiler: Changed types of Char to uint32_t and NativeString to unsigned char*
Lucas Bajolet [Mon, 1 Jun 2015 18:03:56 +0000 (14:03 -0400)]
compiler: Changed types of Char to uint32_t and NativeString to unsigned char*

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

8 years agoMerge: Correct scope in assert else
Jean Privat [Tue, 2 Jun 2015 10:43:05 +0000 (06:43 -0400)]
Merge: Correct scope in assert else

Easy fix in scope.nit, most of the time was spend writing the test file.

Close #1422

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

8 years agoMerge: nitx: add hierarchy lookup commands
Jean Privat [Tue, 2 Jun 2015 10:42:59 +0000 (06:42 -0400)]
Merge: nitx: add hierarchy lookup commands

This PR introduce 4 commands to explore class hierarchies:

* `parents:` for direct parents
* `ancestors`: for all inherited classes
* `children:` for known direct children
* `descendants:` for all the known descandants classes

Also fixes #1420

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

8 years agoMerge: Removed intern dependencies from abstract to flat strings
Jean Privat [Tue, 2 Jun 2015 10:42:54 +0000 (06:42 -0400)]
Merge: Removed intern dependencies from abstract to flat strings

As @privat suggested, here's the PR that cleans the abstract Text class of the string block, this will serve as prelude for the integration of #1400

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

8 years agolib/standard/string: Added new factory to Buffer abstract class
Lucas Bajolet [Wed, 27 May 2015 18:01:35 +0000 (14:01 -0400)]
lib/standard/string: Added new factory to Buffer abstract class

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

8 years agolib/standard/string: Removed flatten method on String, was never used
Lucas Bajolet [Wed, 27 May 2015 18:02:19 +0000 (14:02 -0400)]
lib/standard/string: Removed flatten method on String, was never used

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

8 years agoversion 0.7.5 v0.7.5
Jean Privat [Mon, 1 Jun 2015 14:47:36 +0000 (10:47 -0400)]
version 0.7.5

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

8 years agolib: add module date
MehdiAit [Tue, 13 Jan 2015 15:15:51 +0000 (10:15 -0500)]
lib: add module date

Signed-off-by: MehdiAit <overpex@gmail.com>

8 years agonitvm: Allow to set some attributes in Variable class
Julien Pagès [Sun, 31 May 2015 17:45:29 +0000 (19:45 +0200)]
nitvm: Allow to set some attributes in Variable class

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

8 years agotests: add base_scope.nit
Jean Privat [Sun, 31 May 2015 01:47:38 +0000 (21:47 -0400)]
tests: add base_scope.nit

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

8 years agoscope: the `else` of the assert is a scoped block
Jean Privat [Sun, 31 May 2015 01:45:33 +0000 (21:45 -0400)]
scope: the `else` of the assert is a scoped block

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

8 years agoMerge: Kill `model_utils`
Jean Privat [Sat, 30 May 2015 12:15:42 +0000 (08:15 -0400)]
Merge: Kill `model_utils`

This PR removes the so hated module `model_utils`:

* Useful services are kept in a new module `model::model_collect` that allows to collect and filter things from a `Model`.
* Clients are migrated from `model_utils` to `model_collect` one by one. Misc functionalities used only by one client are moved in the client.

Fixes #710

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

8 years agonitx: add hierarchies commands
Alexandre Terrasa [Sat, 30 May 2015 01:35:47 +0000 (21:35 -0400)]
nitx: add hierarchies commands

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

8 years agonitx: display MEntitiesListArticle in console templates
Alexandre Terrasa [Sat, 30 May 2015 01:35:15 +0000 (21:35 -0400)]
nitx: display MEntitiesListArticle in console templates

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

8 years agonitx: make help message prettier
Alexandre Terrasa [Sat, 30 May 2015 01:34:22 +0000 (21:34 -0400)]
nitx: make help message prettier

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

8 years agonitx: make console composites use `doc_base` titles
Alexandre Terrasa [Sat, 30 May 2015 01:33:37 +0000 (21:33 -0400)]
nitx: make console composites use `doc_base` titles

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

8 years agonitx: introduce `cs_short_list_item` template
Alexandre Terrasa [Sat, 30 May 2015 01:32:49 +0000 (21:32 -0400)]
nitx: introduce `cs_short_list_item` template

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

8 years agoMerge: Fix reading from Sockets
Jean Privat [Sat, 30 May 2015 00:37:42 +0000 (20:37 -0400)]
Merge: Fix reading from Sockets

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

8 years agoMerge: Clean nit compilation directory
Jean Privat [Sat, 30 May 2015 00:37:30 +0000 (20:37 -0400)]
Merge: Clean nit compilation directory

This PR cause the compilation directory to be removed after compilation.

This auto-removal is disabled if `--compile-dir` or `--no-cc` is used because it is a sane default I think.
Moreover, the compilation directory is renamed by defaut to `nit_compile` because there is no more point to make it hidden since its presence means an active request (`--no-cc`).

The PR is a bit premature since the boostrap will fail since `rmdir` requires the light FFI, so it is planned to be merged after the regen of c_src.

Close #792

Pull-Request: #1415
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Warn call on nullable receiver
Jean Privat [Sat, 30 May 2015 00:37:22 +0000 (20:37 -0400)]
Merge: Warn call on nullable receiver

Followup of #1375 and #394

This introduce an advice on calls on a nullable receiver.
Since the conversion could be complex, I propose a light approach with advices (quiet warnings) instead of hard errors, so that:

1. jenkins can track them
2. nitpick (thus vim) can show them
3. mirgration can be done in an incremental and iterative way
4. issues with a strict call-on-nullable policy can be identified without breaking things
5. @Morriar can bank nitcoins in future PR

If (when?) all call on nullable can be removed, then the advice will become an error.

Pull-Request: #1414
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: modelize: ask that attributes in refinements are either noautoninit or have...
Jean Privat [Sat, 30 May 2015 00:37:16 +0000 (20:37 -0400)]
Merge: modelize: ask that attributes in refinements are either noautoninit or have a value

Without value, attributes in introductions does not have the same semantic that attributes in refinements

In introduction attributes are implicitly `autoinit`, in refinements they are `noautoinit`.

This is not POLA since

* this confuse beginners
* readers have to remember if they are in an intro or a refinement
* aditionnal cognitive fragility in constructors (more cases and rules to take in account)

This PR make `autoinit` the default and ask that attributes declared in refinement are either annotated `noautoinit` or have a default value.
This way, the writer has to think about the implication of adding a new attributes in existing classes, especially to think about their initialization. Thus this could help the programmer to avoid bad error.

For the moment, I just display a warning because I want to wait for feedback before doing a big migration (or doing nothing if people hate that), I also want to use jenkins to count and locate these new warnings.

Related to #1322

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

8 years agoMerge: Byte literals
Jean Privat [Sat, 30 May 2015 00:37:07 +0000 (20:37 -0400)]
Merge: Byte literals

As discussed in #1370, the `u8` suffix has been chosen for Byte literal values, this PR introduces it in the compiler

NOTE: Depends on #1403 for integration

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

8 years agoMerge: Byte data type
Jean Privat [Sat, 30 May 2015 00:37:01 +0000 (20:37 -0400)]
Merge: Byte data type

As discussed in #1267, we need a Byte data type to manipulate low-level data as numerics instead of how it is done for now using chars.

This PR will serve as base for future updates, notably related to #1370 which will introduce a way to express Bytes in their literal form.

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

8 years agoMerge: Serialization: change annotation to `serialize` and intro `noserialize`
Jean Privat [Sat, 30 May 2015 00:36:52 +0000 (20:36 -0400)]
Merge: Serialization: change annotation to `serialize` and intro `noserialize`

The annotation `serialize` replaces `auto_serialize` and it is also more versatile. It can annotate a module so all its class definitions are serializable. It can also annotate an attribute so only this attribute is serialized.

The `noserialize` annotation is for exceptions to `serialize`. The most common case is to mark as non-serializable an attribute such as a password or a data blob.

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

8 years agoMerge: Introduction of convex polygons in geometry + benchmarks
Jean Privat [Sat, 30 May 2015 00:36:43 +0000 (20:36 -0400)]
Merge: Introduction of convex polygons in geometry + benchmarks

Nit implementation of the convex polygon data structure.

It's based on the java implementation done during the data structures course.

There also are benchmarks for the Nit implementation and the Java implementation to compare them

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

8 years agoMerge: nitdoc: refactoring and cleaning
Jean Privat [Sat, 30 May 2015 00:36:30 +0000 (20:36 -0400)]
Merge: nitdoc: refactoring and cleaning

Now that nitx and nitdoc are fully merged with the same structure and services, we can start the refactoring to limit the differences between both tools.

Note that the first four commits are from #1401.

Demos from [Jenkins::CI-nitdoc](http://gresil.org/jenkins/job/CI-nitdoc):
* [Standard library](http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/stdlib/index.html)
* [Nit compilers and tools](http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/nitc/index.html)

Pull-Request: #1416
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agonitx: do not call `perform` on nitx special commands
Alexandre Terrasa [Sat, 30 May 2015 00:01:37 +0000 (20:01 -0400)]
nitx: do not call `perform` on nitx special commands

Fixes #1420

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

8 years agonitdoc: fix typo in `doc_poset` comment
Alexandre Terrasa [Thu, 28 May 2015 15:54:54 +0000 (11:54 -0400)]
nitdoc: fix typo in `doc_poset` comment

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

8 years agonitdoc: simplify DefinitionListArticle
Alexandre Terrasa [Thu, 28 May 2015 15:54:30 +0000 (11:54 -0400)]
nitdoc: simplify DefinitionListArticle

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

8 years agonitdoc: remove useless class ImportationListSection
Alexandre Terrasa [Thu, 28 May 2015 15:35:26 +0000 (11:35 -0400)]
nitdoc: remove useless class ImportationListSection

This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.

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

8 years agonitdoc: remove useless class InheritanceListSection
Alexandre Terrasa [Thu, 28 May 2015 15:22:48 +0000 (11:22 -0400)]
nitdoc: remove useless class InheritanceListSection

This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.

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

8 years agonitdoc: remove useless class IntrosRedefsSection
Alexandre Terrasa [Thu, 28 May 2015 15:18:49 +0000 (11:18 -0400)]
nitdoc: remove useless class IntrosRedefsSection

This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.

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

8 years agonitdoc: fix typo in `DefinitionListArticle` comment
Alexandre Terrasa [Thu, 28 May 2015 15:07:14 +0000 (11:07 -0400)]
nitdoc: fix typo in `DefinitionListArticle` comment

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

8 years agonitdoc: remove useless class ConstructorsSection
Alexandre Terrasa [Thu, 28 May 2015 15:06:56 +0000 (11:06 -0400)]
nitdoc: remove useless class ConstructorsSection

This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.

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

8 years agonitdoc: remove useless class ProjectsSection
Alexandre Terrasa [Thu, 28 May 2015 15:04:35 +0000 (11:04 -0400)]
nitdoc: remove useless class ProjectsSection

This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.

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

8 years agonitdoc: factorize list article into `MEntitiesListArticle`
Alexandre Terrasa [Tue, 26 May 2015 23:37:40 +0000 (19:37 -0400)]
nitdoc: factorize list article into `MEntitiesListArticle`

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

8 years agonitdoc: move `DocComposite::is_toc_hidden` to `doc_base`
Alexandre Terrasa [Tue, 26 May 2015 23:25:40 +0000 (19:25 -0400)]
nitdoc: move `DocComposite::is_toc_hidden` to `doc_base`

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

8 years agonitdoc: introduce `DocComposite::is_hidden` services in `doc_base`
Alexandre Terrasa [Tue, 26 May 2015 21:31:22 +0000 (17:31 -0400)]
nitdoc: introduce `DocComposite::is_hidden` services in `doc_base`

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

8 years agonitdoc: move `DocComposite::toc_title` in `doc_base`
Alexandre Terrasa [Tue, 26 May 2015 21:04:00 +0000 (17:04 -0400)]
nitdoc: move `DocComposite::toc_title` in `doc_base`

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

8 years agonitdoc: introduce pretty printing of composite tree
Alexandre Terrasa [Fri, 22 May 2015 07:09:47 +0000 (03:09 -0400)]
nitdoc: introduce pretty printing of composite tree

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

8 years agonitdoc: move `DocComposite::title` to `doc_base`
Alexandre Terrasa [Fri, 29 May 2015 23:05:46 +0000 (19:05 -0400)]
nitdoc: move `DocComposite::title` to `doc_base`

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

8 years agonitdoc: replace `group:` prefix id by `.group` suffix
Alexandre Terrasa [Tue, 26 May 2015 20:44:58 +0000 (16:44 -0400)]
nitdoc: replace `group:` prefix id by `.group` suffix

Because some HTML/JS tools do not like `:` in ids...

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

8 years agonitdoc: replace `concern:` prefix id by `.concern` suffix
Alexandre Terrasa [Tue, 26 May 2015 20:43:33 +0000 (16:43 -0400)]
nitdoc: replace `concern:` prefix id by `.concern` suffix

Because some HTML/JS tools do not like `:` in ids...

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

8 years agonitdoc: replace `article:` prefix id by `.article` suffix
Alexandre Terrasa [Tue, 26 May 2015 20:40:32 +0000 (16:40 -0400)]
nitdoc: replace `article:` prefix id by `.article` suffix

Because some HTML/JS tools do not like `:` in ids...

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

8 years agonitdoc: replace `section:` prefix id by `.section` suffix
Alexandre Terrasa [Tue, 26 May 2015 20:30:32 +0000 (16:30 -0400)]
nitdoc: replace `section:` prefix id by `.section` suffix

Because some HTML/JS tools do not like `:` in ids...

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

8 years agonitdoc: move `DocComposite::id` to `doc_base`
Alexandre Terrasa [Fri, 29 May 2015 23:02:35 +0000 (19:02 -0400)]
nitdoc: move `DocComposite::id` to `doc_base`

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

8 years agotests: fix tests for nitmetrics
Alexandre Terrasa [Mon, 25 May 2015 20:56:03 +0000 (16:56 -0400)]
tests: fix tests for nitmetrics

Because the imported modules changed, the linearizations of the metrics phases changed and informations are not displayed in the same order.
Also, using the new framework, more classes are discovered, this is why the MENDEL values are slightly different.

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

8 years agotests: fix tests for nituml
Alexandre Terrasa [Mon, 25 May 2015 15:40:22 +0000 (11:40 -0400)]
tests: fix tests for nituml

Old model_utils did not listed the init methods, the new model_collect does that.
So I fixed the correct result in the tests.

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

8 years agosrc: remove unused module `model_utils`
Alexandre Terrasa [Fri, 22 May 2015 00:26:40 +0000 (20:26 -0400)]
src: remove unused module `model_utils`

Fixes #710

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

8 years agonitdoc: migrate to `model_collect`
Alexandre Terrasa [Fri, 22 May 2015 00:26:08 +0000 (20:26 -0400)]
nitdoc: migrate to `model_collect`

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

8 years agovim_autocomplete: migrate to `model_collect`
Alexandre Terrasa [Fri, 22 May 2015 00:25:51 +0000 (20:25 -0400)]
vim_autocomplete: migrate to `model_collect`

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

8 years agonitmetrics: migrate to `model_utils`
Alexandre Terrasa [Fri, 22 May 2015 00:25:25 +0000 (20:25 -0400)]
nitmetrics: migrate to `model_utils`

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

8 years agonitserial: remove dependency to `model_utils`
Alexandre Terrasa [Fri, 22 May 2015 00:24:47 +0000 (20:24 -0400)]
nitserial: remove dependency to `model_utils`

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

8 years agotest_neo: migrate to `model_collect`
Alexandre Terrasa [Fri, 22 May 2015 00:23:52 +0000 (20:23 -0400)]
test_neo: migrate to `model_collect`

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

8 years agouml: remove useless repeated type in redef
Alexandre Terrasa [Fri, 22 May 2015 00:23:34 +0000 (20:23 -0400)]
uml: remove useless repeated type in redef

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

8 years agouml: migrate to `model_collect`
Alexandre Terrasa [Fri, 22 May 2015 00:23:13 +0000 (20:23 -0400)]
uml: migrate to `model_collect`

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

8 years agomodel: introduce `model_collect` to collect and filter things from a `Model`
Alexandre Terrasa [Mon, 25 May 2015 15:44:56 +0000 (11:44 -0400)]
model: introduce `model_collect` to collect and filter things from a `Model`

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

8 years agomodel_utils: move shortcuts to `MClassKind` in `model`
Alexandre Terrasa [Thu, 21 May 2015 22:32:27 +0000 (18:32 -0400)]
model_utils: move shortcuts to `MClassKind` in `model`

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

8 years agomodel_utils: move `MEntityNameSorter` to `model_base`.
Alexandre Terrasa [Thu, 21 May 2015 22:22:29 +0000 (18:22 -0400)]
model_utils: move `MEntityNameSorter` to `model_base`.

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

8 years agomodel_utils: remove unused method `imported_mclasses`
Alexandre Terrasa [Thu, 21 May 2015 22:00:14 +0000 (18:00 -0400)]
model_utils: remove unused method `imported_mclasses`

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