nit.git
9 years agoneo_doxygen: Include a tip for Python in the `README`.
Jean-Christophe Beaupré [Wed, 17 Dec 2014 20:24:16 +0000 (15:24 -0500)]
neo_doxygen: Include a tip for Python in the `README`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Add an option to remove the `def` keyword of Python.
Jean-Christophe Beaupré [Wed, 17 Dec 2014 20:18:24 +0000 (15:18 -0500)]
neo_doxygen: Add an option to remove the `def` keyword of Python.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoMerge: tests: `grep` in skip os is now silent
Jean Privat [Fri, 19 Dec 2014 03:08:28 +0000 (22:08 -0500)]
Merge: tests: `grep` in skip os is now silent

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

9 years agoMerge: neo4j: Remove the old `jsonable` library.
Jean Privat [Fri, 19 Dec 2014 03:08:18 +0000 (22:08 -0500)]
Merge: neo4j: Remove the old `jsonable` library.

That library is useless since PR #907.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: Arrays comprehension
Jean Privat [Fri, 19 Dec 2014 03:07:20 +0000 (22:07 -0500)]
Merge: Arrays comprehension

Implements and closes #896

Was not as hard as expected, not bad for less than 12 hours of thinking, coding and sleeping.

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

9 years agotests: `grep` in skip os is now silent
Jean Privat [Thu, 18 Dec 2014 17:40:16 +0000 (12:40 -0500)]
tests: `grep` in skip os is now silent

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

9 years agoMerge: Nitcorn: fixes crash on bufferized inputs
Jean Privat [Thu, 18 Dec 2014 16:40:55 +0000 (11:40 -0500)]
Merge: Nitcorn: fixes crash on bufferized inputs

So... I'm not proud of this patch but it works so better this than nothing.

Partially fixes #1027 waiting for better.

Ping
@jpcaissy
@xymus

Pull-Request: #1031
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Reviewed-by: Jean Privat <jean@pryen.org>

9 years agoMerge: lib/json: introduces json store a simple json data storage system.
Jean Privat [Thu, 18 Dec 2014 16:40:51 +0000 (11:40 -0500)]
Merge: lib/json: introduces json store a simple json data storage system.

Store and load json data.

This simple system can be used to store and retrieve json data.

## Usage

Create a new JsonStore or reuse an existing one.
~~~
var store = new JsonStore("store_dir")
~~~

JsonStore can store json of type JsonObject and JsonArray.
~~~
var color = "red"
var obj = new JsonObject
obj["color"] = name
obj["code"] = "FF0000"
~~~

Data are stored under a key.
~~~
var key = "colors/{name}"
~~~

Store the object.
~~~
store.store_object(key, obj)
assert store.has_key(key)
~~~

Load the object.
~~~
assert store.has_key(key)
var red = store.load_object(key)
assert res["name"] == name
~~~

Clear all stored data.
~~~
store.clear
~~~

*Copied from module documentation.*

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

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

9 years agoMerge: nitdoc: Fix IDs
Jean Privat [Thu, 18 Dec 2014 16:40:46 +0000 (11:40 -0500)]
Merge: nitdoc: Fix IDs

Fix Nitdoc’s IDs to make them more robust and less redundant.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: GitHub api
Jean Privat [Thu, 18 Dec 2014 14:28:31 +0000 (09:28 -0500)]
Merge: GitHub api

Première PR d'une pas si longue série.

Juste histoire de montrer un aperçu du fonctionnement.

Please review only the last two commits.

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

9 years agonitdoc: Avoid HTML ID collisions.
Jean-Christophe Beaupré [Fri, 12 Dec 2014 19:40:38 +0000 (14:40 -0500)]
nitdoc: Avoid HTML ID collisions.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Shorten redundant IDs.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:13:58 +0000 (11:13 -0500)]
nitdoc: Shorten redundant IDs.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Remove the project’s name from the groups’ IDs.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:12:56 +0000 (11:12 -0500)]
nitdoc: Remove the project’s name from the groups’ IDs.

A project is only a wrapper on a group.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Mangle names in IDs.
Jean-Christophe Beaupré [Fri, 12 Dec 2014 20:40:39 +0000 (15:40 -0500)]
nitdoc: Mangle names in IDs.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Document constraints on `nitdoc_id`.
Jean-Christophe Beaupré [Fri, 12 Dec 2014 19:07:15 +0000 (14:07 -0500)]
nitdoc: Document constraints on `nitdoc_id`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Use a fully qualified ID for classes.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:11:00 +0000 (11:11 -0500)]
nitdoc: Use a fully qualified ID for classes.

Avoid conflict when two modules define two different classes with the
same name. This also permits to support classes generated implicitly by
`neo_doxygen`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Group non-Nit entities at the bottom of `doc_model.nit`.
Jean-Christophe Beaupré [Fri, 12 Dec 2014 14:38:01 +0000 (09:38 -0500)]
nitdoc: Group non-Nit entities at the bottom of `doc_model.nit`.

Follow the division indicated by the comments in this file.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitdoc: Fix a minor documentation mistake.
Jean-Christophe Beaupré [Fri, 12 Dec 2014 19:08:15 +0000 (14:08 -0500)]
nitdoc: Fix a minor documentation mistake.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agostring: Fix `to_cmangle` to never end with an underscore.
Jean-Christophe Beaupré [Fri, 12 Dec 2014 14:55:40 +0000 (09:55 -0500)]
string: Fix `to_cmangle` to never end with an underscore.

This permits to use two underscores as a separator between two mangled
names (like Nitdoc does).

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agostring: Fix `to_cmangle` to always produce valid C identifiers.
Jean-Christophe Beaupré [Sat, 13 Dec 2014 17:09:34 +0000 (12:09 -0500)]
string: Fix `to_cmangle` to always produce valid C identifiers.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agolib/json: introduces json store a simple json data storage system.
Alexandre Terrasa [Thu, 18 Dec 2014 13:44:55 +0000 (08:44 -0500)]
lib/json: introduces json store a simple json data storage system.

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

9 years agoMerge: Do not inline lazy getter
Jean Privat [Thu, 18 Dec 2014 01:15:00 +0000 (20:15 -0500)]
Merge: Do not inline lazy getter

nitc-sg's aggressive inlining caused a stack overflow during the compilation of recursive lazy attributes

Needed to pass #1011

Pull-Request: #1044

9 years agoMerge: neo: Remove `full_name`.
Jean Privat [Thu, 18 Dec 2014 01:14:31 +0000 (20:14 -0500)]
Merge: neo: Remove `full_name`.

This is not an attribute in the Nit model.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoneo4j: Remove the old `jsonable` library.
Jean-Christophe Beaupré [Wed, 17 Dec 2014 21:34:28 +0000 (16:34 -0500)]
neo4j: Remove the old `jsonable` library.

That library is useless since PR #907.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agolib/nitcorn: handles bufferized request content
Alexandre Terrasa [Wed, 17 Dec 2014 21:05:13 +0000 (16:05 -0500)]
lib/nitcorn: handles bufferized request content

Partially fixes #1027

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

9 years agolib/nitcorn: allows access to POST raw body
Alexandre Terrasa [Wed, 17 Dec 2014 20:57:56 +0000 (15:57 -0500)]
lib/nitcorn: allows access to POST raw body

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

9 years agotests: add base_lazy3.nit
Jean Privat [Wed, 17 Dec 2014 20:43:10 +0000 (15:43 -0500)]
tests: add base_lazy3.nit

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

9 years agocompiler: do not inline lazy getters
Jean Privat [Wed, 17 Dec 2014 20:42:01 +0000 (15:42 -0500)]
compiler: do not inline lazy getters

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

9 years agotests: add test_comprehension.nit
Jean Privat [Wed, 17 Dec 2014 18:56:31 +0000 (13:56 -0500)]
tests: add test_comprehension.nit

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

9 years agotransform: transform array comprehension in simpler statements
Jean Privat [Wed, 17 Dec 2014 16:50:55 +0000 (11:50 -0500)]
transform: transform array comprehension in simpler statements

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

9 years agotransform: introduce `full_transform_visitor` for complex transformations
Jean Privat [Wed, 17 Dec 2014 16:50:04 +0000 (11:50 -0500)]
transform: introduce `full_transform_visitor` for complex transformations

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

9 years agonitg: handle direct compilation of comprehension arrays
Jean Privat [Wed, 17 Dec 2014 16:48:32 +0000 (11:48 -0500)]
nitg: handle direct compilation of comprehension arrays

Because of `transform`, it is only used if compiled
with `--disable-phase transform`

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

9 years agointerpreter: implements array comprehensions
Jean Privat [Wed, 17 Dec 2014 18:46:50 +0000 (13:46 -0500)]
interpreter: implements array comprehensions

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

9 years agotyping: mark expressions that belong to an array comprehension
Jean Privat [Wed, 17 Dec 2014 18:45:58 +0000 (13:45 -0500)]
typing: mark expressions that belong to an array comprehension

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

9 years agotyping: add `AArrayExpr::element_mtype`
Jean Privat [Wed, 17 Dec 2014 16:45:42 +0000 (11:45 -0500)]
typing: add `AArrayExpr::element_mtype`

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

9 years agoparser: regenerate with comprehension arrays
Jean Privat [Wed, 17 Dec 2014 10:38:34 +0000 (05:38 -0500)]
parser: regenerate with comprehension arrays

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

9 years agogrammar: extends array_item to accept array extension elements
Jean Privat [Wed, 17 Dec 2014 10:28:34 +0000 (05:28 -0500)]
grammar: extends array_item to accept array extension elements

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

9 years agogrammar: new production `array_items` to replace arg_list for literal arrays
Jean Privat [Wed, 17 Dec 2014 10:24:43 +0000 (05:24 -0500)]
grammar: new production `array_items` to replace arg_list for literal arrays

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

9 years agolib/github: introduces object oriented interface for GithubAPI
Alexandre Terrasa [Wed, 17 Dec 2014 20:12:23 +0000 (15:12 -0500)]
lib/github: introduces object oriented interface for GithubAPI

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

9 years agolib/github: introduces GithubCurl::get_and_parse to handle API error without aborting
Alexandre Terrasa [Mon, 15 Dec 2014 13:13:07 +0000 (08:13 -0500)]
lib/github: introduces GithubCurl::get_and_parse to handle API error without aborting

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

9 years agoneo_doxygen: Unlink `name` and `full_name`.
Jean-Christophe Beaupré [Wed, 17 Dec 2014 16:53:18 +0000 (11:53 -0500)]
neo_doxygen: Unlink `name` and `full_name`.

Also, remove `full_name` from the graph.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoMerge: Highlight line ids
Jean Privat [Wed, 17 Dec 2014 04:55:37 +0000 (23:55 -0500)]
Merge: Highlight line ids

Add a way to control the generation of HTML ids in `hightlight` so it can be disabled in nitdoc.
Multiple id `L1` in a same HTML document makes it non conform.

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

9 years agoMerge: Name entities
Jean Privat [Wed, 17 Dec 2014 04:55:22 +0000 (23:55 -0500)]
Merge: Name entities

As suggested in #986 and #1030, promote `full_name` and `c_name` in MEntity in model so client of the model will have some homogenous ways to names entities.

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

9 years agoMerge: Check constructor name conflicts
Jean Privat [Wed, 17 Dec 2014 04:55:15 +0000 (23:55 -0500)]
Merge: Check constructor name conflicts

Closes #973

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

9 years agoMerge: neo_doxygen: Clean the code a little bit
Jean Privat [Wed, 17 Dec 2014 04:54:53 +0000 (23:54 -0500)]
Merge: neo_doxygen: Clean the code a little bit

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: brainfuck: Remove warnings.
Jean Privat [Wed, 17 Dec 2014 04:54:37 +0000 (23:54 -0500)]
Merge: brainfuck: Remove warnings.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: opportunity: Fix some warnings
Jean Privat [Wed, 17 Dec 2014 04:54:26 +0000 (23:54 -0500)]
Merge: opportunity: Fix some warnings

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: Each line
Jean Privat [Wed, 17 Dec 2014 04:54:21 +0000 (23:54 -0500)]
Merge: Each line

Improve IStream and Path for easiness of reading.

First, add new iterator `each_line` that lazily `read_line` of a stream.

Second, wrap some reading methods on `Path` so that the input of data from files is really easy.

~~~nit
var content = "/etc/issue".to_path.read_all
print content
~~~

and

~~~nit
for l in "/etc/passwd".to_path.each_line do
   var fields = l.split(":")
   print "name={fields[0]} uid={fields[2]}"
end
~~~

TODO: better error management

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

9 years agoMerge: Fast docunits
Jean Privat [Wed, 17 Dec 2014 04:54:15 +0000 (23:54 -0500)]
Merge: Fast docunits

nitunit use the trick of #947 to optimize the execution of simple docunits.

There is now two execution modes: the *single* one and the *simple* one.

*simple* is for docunits that contains only some statements (without importation, classes or functions)
All *simple* docunits of a single module are regrouped into the same program with a switch that calls the correct docunit.

*single* is for docunits that contains importations, classes, functions, etc.
It the the old mode, that compiles and executes each docunit individually.

In case of compilation error with the *simple* mode, the *single* mode is used as a fallback.
Therefore the precise compilation error is assigned to the correct docunit and the other docunits can still be tested.

For numbers, I used `string` that contains 65 simple docunits:

* before: 1m16.564s
* after: 0m1.664s (so a gain of 97.80%)

Close #947

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

9 years agoMerge: contrib: download files from RSS
Jean Privat [Wed, 17 Dec 2014 04:54:09 +0000 (23:54 -0500)]
Merge: contrib: download files from RSS

Based on #831, ignore the first 4 commits.

### From the README

This tool downloads files pointed by RSS feeds.

It fetches the content of the RSS feed, the it filters it according to custom patterns and to existing folders on disk. Selected elements will be downloaded to the given folder.

This tool must be compiled with its configuration in order to work. See the `sample_config.nit` in `src/`.

#### Features and TODO

- [x] Download & parse RSS file
- [x] Generate regular expressions from local folders
- [x] Auto download files matching regular expressions
- [x] Memory to prevent double downloads
- [ ] Blacklist
- [ ] Use a cleaner RSS parser
- [ ] Tolerate more feed formats

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

9 years agomodel: promote `c_name` from abstract-compiler to model
Jean Privat [Tue, 16 Dec 2014 04:09:49 +0000 (23:09 -0500)]
model: promote `c_name` from abstract-compiler to model

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

9 years agomodel: add `full_name` to entities that miss one
Jean Privat [Tue, 16 Dec 2014 04:08:18 +0000 (23:08 -0500)]
model: add `full_name` to entities that miss one

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

9 years agomodel: promote `full_name` to MEntity
Jean Privat [Tue, 16 Dec 2014 04:05:32 +0000 (23:05 -0500)]
model: promote `full_name` to MEntity

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

9 years agolib/opts: do not crash for empty arguments
Jean Privat [Tue, 16 Dec 2014 19:10:32 +0000 (14:10 -0500)]
lib/opts: do not crash for empty arguments

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

9 years agoman: add --no-line-id to nitlight.md
Jean Privat [Tue, 16 Dec 2014 16:05:42 +0000 (11:05 -0500)]
man: add --no-line-id to nitlight.md

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

9 years agonitlight: add option --no-line-id
Jean Privat [Tue, 16 Dec 2014 16:04:48 +0000 (11:04 -0500)]
nitlight: add option --no-line-id

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

9 years agonitodoc: stop generating id for lines in examples
Jean Privat [Tue, 16 Dec 2014 13:57:53 +0000 (08:57 -0500)]
nitodoc: stop generating id for lines in examples

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

9 years agohighlight: add HighlightVisitor::line_id_prefix to control ids of line spans
Jean Privat [Tue, 16 Dec 2014 13:57:05 +0000 (08:57 -0500)]
highlight: add HighlightVisitor::line_id_prefix to control ids of line spans

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

9 years agotests: error_defs_init.nit for a combinasion of 7*7 cases
Jean Privat [Tue, 16 Dec 2014 21:21:14 +0000 (16:21 -0500)]
tests: error_defs_init.nit for a combinasion of 7*7 cases

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

9 years agomodelize: check property name conflicts for constructors and factories
Jean Privat [Tue, 16 Dec 2014 21:17:14 +0000 (16:17 -0500)]
modelize: check property name conflicts for constructors and factories

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

9 years agomodelize: check_redef_property_visibility for root_init
Jean Privat [Tue, 16 Dec 2014 21:16:38 +0000 (16:16 -0500)]
modelize: check_redef_property_visibility for root_init

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

9 years agolib/file: add examples for the new read methods in Path
Jean Privat [Tue, 16 Dec 2014 19:42:37 +0000 (14:42 -0500)]
lib/file: add examples for the new read methods in Path

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

9 years agoneo_doxygen: Make an instruction less verbose.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:57:11 +0000 (11:57 -0500)]
neo_doxygen: Make an instruction less verbose.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Do not manually flush the output.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:56:24 +0000 (11:56 -0500)]
neo_doxygen: Do not manually flush the output.

The standard library now takes care of this for us.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agolib/file: protect from double close
Jean Privat [Tue, 16 Dec 2014 10:46:25 +0000 (05:46 -0500)]
lib/file: protect from double close

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

9 years agotests: add test_file_read2.nit
Jean Privat [Tue, 16 Dec 2014 10:30:31 +0000 (05:30 -0500)]
tests: add test_file_read2.nit

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

9 years agolib/file: add read methods in Path
Jean Privat [Tue, 16 Dec 2014 10:24:24 +0000 (05:24 -0500)]
lib/file: add read methods in Path

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

9 years agolib/stream: add IStream::each_line
Jean Privat [Tue, 16 Dec 2014 10:20:55 +0000 (05:20 -0500)]
lib/stream: add IStream::each_line

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

9 years agoneo_doxygen: Manage top-level namespaces in `doxml`.
Jean-Christophe Beaupré [Mon, 15 Dec 2014 21:22:20 +0000 (16:22 -0500)]
neo_doxygen: Manage top-level namespaces in `doxml`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Move the processing of Doxygen’s names in `doxml`.
Jean-Christophe Beaupré [Mon, 15 Dec 2014 20:08:24 +0000 (15:08 -0500)]
neo_doxygen: Move the processing of Doxygen’s names in `doxml`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Remove references to `nitg`.
Jean-Christophe Beaupré [Mon, 15 Dec 2014 16:35:06 +0000 (11:35 -0500)]
neo_doxygen: Remove references to `nitg`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo: Remove `full_name`.
Jean-Christophe Beaupré [Mon, 15 Dec 2014 16:17:01 +0000 (11:17 -0500)]
neo: Remove `full_name`.

This is not an attribute in the Nit model.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agobrainfuck: Remove warnings.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 15:20:04 +0000 (10:20 -0500)]
brainfuck: Remove warnings.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoopportunity: Add missing documentation.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 14:48:29 +0000 (09:48 -0500)]
opportunity: Add missing documentation.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoopportunity: Respect the basic HTML structure.
Jean-Christophe Beaupré [Tue, 16 Dec 2014 14:59:01 +0000 (09:59 -0500)]
opportunity: Respect the basic HTML structure.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitunit: enable the execution of simple docunit in a single program
Jean Privat [Mon, 15 Dec 2014 20:33:39 +0000 (15:33 -0500)]
nitunit: enable the execution of simple docunit in a single program

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

9 years agoMerge: neo_doxygen: Support namespaces’ members
Jean Privat [Tue, 16 Dec 2014 04:18:04 +0000 (23:18 -0500)]
Merge: neo_doxygen: Support namespaces’ members

In some languages, like Python, the immediate parent of a member is not necessary a class. So, for cases when namespace as direct members, add an implicit class named `(self)` to list them in a Nit model.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

9 years agoMerge: Improve construction of runtime structures
Jean Privat [Tue, 16 Dec 2014 04:16:31 +0000 (23:16 -0500)]
Merge: Improve construction of runtime structures

The nitvm does not use anymore model_utils.

The construction of runtime structures has changed and is more efficient than before.
Perfs: the nitvm is a little slower than the naive_interpreter instead of up to 2 times slower before this PR on some benchmarks.

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

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

9 years agoMerge: nitester on Turing: fix to use nitc + faster and lighter execution
Jean Privat [Tue, 16 Dec 2014 04:16:26 +0000 (23:16 -0500)]
Merge: nitester on Turing: fix to use nitc + faster and lighter execution

#1000 broke Turing compatibility, this fix it.

Also, do not compile nit and nitvm 30 times in parallel, do it once an copy it 30 times.

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

9 years agoMerge: Doc down
Jean Privat [Tue, 16 Dec 2014 04:16:20 +0000 (23:16 -0500)]
Merge: Doc down

Please disregard commits before 0a57951, they belong to #680.

This pull request remove the module `src/markdown` and use the newly introduced `markdown` parser instead.

## Major changes considering Nit comments

### Synopsys line

Synopsys line must be followed by a blank line for multilines comments according to the Markdown paragraph syntax.

Example before:

    # foo doc
    fun foo do end

    # bar doc
    # more doc or doc unit
    fun bar do end

After:

    # foo doc
    fun foo do end

    # bar doc
    #
    # more doc or doc unit
    fun bar do end

This is boring, I know, but it allows Nit comment to be properly parsed by most of the markdown parsers.
Also, most of multilne comments are already corrects.

### Code blocks

Code blocks (and doc unit) are now parsed following the correct rule: every line starting with at least 4 spaces is a code block (if not in a nested list).

Example before:

    #    assert true # was not recognized by nitdoc and nitunit
    fun foo do end

After:

    #    assert true # works in nitunit and nitdoc
    fun foo do end

Commit 0b275eb performs those changes on lib/standard as example.

## What's new?

### Full markdown syntax available

All the original markdown syntax is now recognized by the parser (link definitions, blockquotes, nested elements, escape...).
I'm working to add a Github flavoured mode and maby a custom mode for Nitdoc.

### Nitdoc annotations

Some annotations are now recognized in the comments. They do nothing but allow nitdoc to add some style.

Annotation list:

* DEPRECATED
* SEE
* REQUIRE, ENSURE
* FIXME, TODO, NOTE

Syntax:

    # Some doc
    #
    # DEPRECATED: use `bar` instead.
    fun foo do end

## TODO

Some tests maybe broken in lib/ and src/ because of the synopsys change, I will update this PR with fixes.

We now have everything we need to work on a Nit flavoured markdown allowing to control nitdoc generation. This is the next step.

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

9 years agoMerge: Fix lazy attribute in semi-global compiler
Jean Privat [Tue, 16 Dec 2014 04:16:14 +0000 (23:16 -0500)]
Merge: Fix lazy attribute in semi-global compiler

Solve two bugs related to inlining in semi-global that was identified with the lazy attributes.

The first one is the call of a inlinable lazy attribute on a nullable object that caused an assert fail in the compiler.

The second is the usage of label in inlined code that could conflict.

This is needed to integrate #683 and #1011

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

9 years agonitunit: separate extraction and execution of docunits
Jean Privat [Mon, 15 Dec 2014 20:31:53 +0000 (15:31 -0500)]
nitunit: separate extraction and execution of docunits

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

9 years agoneo_doxygen: Add a Python test for namespaces’ members.
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:51:30 +0000 (15:51 -0500)]
neo_doxygen: Add a Python test for namespaces’ members.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Set the location of implicit classes.
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:53:12 +0000 (15:53 -0500)]
neo_doxygen: Set the location of implicit classes.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Add a missing getter in `Entity`.
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:36:28 +0000 (15:36 -0500)]
neo_doxygen: Add a missing getter in `Entity`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Include namespaces’ members.
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:50:25 +0000 (15:50 -0500)]
neo_doxygen: Include namespaces’ members.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Never commit generated makefiles.
Jean-Christophe Beaupré [Fri, 5 Dec 2014 20:00:14 +0000 (15:00 -0500)]
neo_doxygen: Never commit generated makefiles.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Add information about requirements to generate tests.
Jean-Christophe Beaupré [Fri, 5 Dec 2014 19:55:21 +0000 (14:55 -0500)]
neo_doxygen: Add information about requirements to generate tests.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Use `ProjectGraph.project_name` in `RootNamespace`.
Jean-Christophe Beaupré [Fri, 5 Dec 2014 19:53:27 +0000 (14:53 -0500)]
neo_doxygen: Use `ProjectGraph.project_name` in `RootNamespace`.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agoneo_doxygen: Support more section kinds.
Jean-Christophe Beaupré [Wed, 3 Dec 2014 21:54:42 +0000 (16:54 -0500)]
neo_doxygen: Support more section kinds.

Also document what is not supported yet.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

9 years agonitvm: Improve construction of runtime structures
Julien Pagès [Mon, 15 Dec 2014 15:24:10 +0000 (10:24 -0500)]
nitvm: Improve construction of runtime structures

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

9 years agotests: add base_attr_lazy2.nit
Jean Privat [Mon, 15 Dec 2014 15:23:23 +0000 (10:23 -0500)]
tests: add base_attr_lazy2.nit

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

9 years agocompiler: use correct recvtype in `AAttrPropdef::evaluate_expr`
Jean Privat [Mon, 15 Dec 2014 15:22:30 +0000 (10:22 -0500)]
compiler: use correct recvtype in `AAttrPropdef::evaluate_expr`

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

9 years agocontrib/nitester: sort tests per engine first
Alexis Laferrière [Sun, 14 Dec 2014 03:28:58 +0000 (22:28 -0500)]
contrib/nitester: sort tests per engine first

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

9 years agocontrib/nitester: tweak verbose level of some messages
Alexis Laferrière [Sun, 14 Dec 2014 03:16:54 +0000 (22:16 -0500)]
contrib/nitester: tweak verbose level of some messages

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

9 years agotests: skip long interpreter tests
Alexis Laferrière [Sun, 14 Dec 2014 03:15:37 +0000 (22:15 -0500)]
tests: skip long interpreter tests

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

9 years agocontrib/nitester: in verbose mode, each worker prints its completed task
Alexis Laferrière [Sun, 14 Dec 2014 03:08:16 +0000 (22:08 -0500)]
contrib/nitester: in verbose mode, each worker prints its completed task

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

9 years agotests: fix nitg-g blacklist of nitpretty
Alexis Laferrière [Sun, 14 Dec 2014 02:33:23 +0000 (21:33 -0500)]
tests: fix nitg-g blacklist of nitpretty

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

9 years agonitester & wrapper: compile nit and nitvm on the controller, and use nitc
Alexis Laferrière [Sat, 13 Dec 2014 20:07:59 +0000 (15:07 -0500)]
nitester & wrapper: compile nit and nitvm on the controller, and use nitc

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

9 years agocompiler: associate escape_marks to to frame (because of inlining)
Jean Privat [Mon, 15 Dec 2014 15:08:28 +0000 (10:08 -0500)]
compiler: associate escape_marks to to frame (because of inlining)

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