nit.git
6 years agomacOS: skip one of the nitpm tests because of locale issues
Alexis Laferrière [Fri, 11 May 2018 14:41:45 +0000 (10:41 -0400)]
macOS: skip one of the nitpm tests because of locale issues

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

6 years agoMerge: android: remove the deprecated armeabi target platform
Jean Privat [Fri, 11 May 2018 03:14:25 +0000 (23:14 -0400)]
Merge: android: remove the deprecated armeabi target platform

Android NDK tools do not support the armeabi target platform anymore, breaking the compilation of all Nit app for Android. This PR removes this target, fixing our compilation issues. This platform version should not be active anywhere, it was widely replaced by armeabi-v7a.

Unless you update the Android SDK tool, compiling Nit apps for Android should still work on your machine and the CI server. However, it fails on the Nit docker, as with:
https://gitlab.com/xymus/darpg/-/jobs/67649353
https://gitlab.com/Skyline76/memory_gamnit/-/jobs/67571796

Pull-Request: #2671

6 years agoMerge: lib/crypto: add in-place xor cipher on CStrings
Jean Privat [Fri, 11 May 2018 03:14:18 +0000 (23:14 -0400)]
Merge: lib/crypto: add in-place xor cipher on CStrings

The xor operation as defined in xor_ciphers lacked a performance-aware
version on byte sequences.

This commit adds a fast version to perform it on a CString.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2669

6 years agoMerge: lib: add `package.desc` keys to the `package.ini` file of most of the packages...
Jean Privat [Fri, 11 May 2018 03:13:52 +0000 (23:13 -0400)]
Merge: lib: add `package.desc` keys to the `package.ini` file of most of the packages in `lib`

This PR adds a `package.desc` key to all `package.ini` files into `lib/`.

For most of them the description is imported from the `mdoc_or_fallback.synopsis` with some light modifications (removing the starting `#` and the trailing `.`).

After this automated fix, 5 packages still missed the `package.desc` key:
* `dummy_array`
* `filter_stream`
* `graph`
* `mnit`
* `postgresql`

I manually added the key for `graph` and `postgresql`, so after this PR only 3 packages still miss the key:
* `dummy_array`
* `filter_stream`
* `mnit`

Pull-Request: #2667

6 years agoMerge: lib/core/text: add memset to `CString`
Jean Privat [Fri, 11 May 2018 03:13:51 +0000 (23:13 -0400)]
Merge: lib/core/text: add memset to `CString`

Memset is an operation used for setting bytes to a particular value.

Since it was not defined on CStrings, we add it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2668

6 years agoandroid: remove the deprecated armeabi target
Alexis Laferrière [Fri, 11 May 2018 02:01:35 +0000 (22:01 -0400)]
android: remove the deprecated armeabi target

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

6 years agoMerge: lib/core: provide default codec-aware read_char
Jean Privat [Thu, 10 May 2018 22:46:06 +0000 (18:46 -0400)]
Merge: lib/core: provide default codec-aware read_char

Previous implementations of read_char were unaware of codec issues, and
used to read a byte and convert it to a code point.

For ASCII characters this was enough, but once unicode characters were
read on a char-by-char basis, wrong characters would appear.

This commit fixes this issue by using the Codec API to read a character
intelligently, and properly support multibyte encodings.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

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

6 years agoMerge: doc/commands: introduce `main` related commands
Jean Privat [Thu, 10 May 2018 22:46:06 +0000 (18:46 -0400)]
Merge: doc/commands: introduce `main` related commands

This PR introduce new doc commands related to executable files:
* `CmdMains`: list all executable files from a package
* `CmdMainCompile`: return the `nitc` command to compile an executable file
* `CmdTesting`: return the `nitunit` command to test a package
* `CmdManSynopsis`: return the command synopsis from its manpage
* `CmdManOptions`: return the command options descriptions from its manpage

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

6 years agoMerge: json: rename and improve the quick and easy `deserialize_json`
Jean Privat [Thu, 10 May 2018 22:46:05 +0000 (18:46 -0400)]
Merge: json: rename and improve the quick and easy `deserialize_json`

Rename the service `String::from_json_string` to a nicer `deserialize_json`. I believe that the old name was counter-intuitive and may explain why the method was used so rarely/never.

Add the argument `static_type` to `deserialize_json` to limit the type of objects that can be deserialized. This argument is passed directly to the JSON deserializer.

The method `deserialize_json` still prints errors to the console, so it should be used for quick prototypes or scripts.

This could make prettier and safer examples in #2655.

Pull-Request: #2664

6 years agolib/core: provide default codec-aware read_char
Lucas Bajolet [Mon, 7 May 2018 14:45:21 +0000 (10:45 -0400)]
lib/core: provide default codec-aware read_char

Previous implementations of read_char were unaware of codec issues, and
used to read a byte and convert it to a code point.

For ASCII characters this was enough, but once unicode characters were
read on a char-by-char basis, wrong characters would appear.

This commit fixes this issue by using the Codec API to read a character
intelligently, and properly support multibyte encodings.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agoniti: fix CString::fast_cstring semantics
Lucas Bajolet [Tue, 8 May 2018 16:01:30 +0000 (12:01 -0400)]
niti: fix CString::fast_cstring semantics

The old implementation of CString::fast_cstring used to create a new
CString instance instead of sharing the underlying buffer.

This in turn caused code relying on this semantic to fail as the memory
was not re-initialized properly.

This commit fixes this behaviour by introducing a new cstring
constructor specific for the VM and Interpreter.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agotests: fix tests related to test_prog
Alexandre Terrasa [Tue, 8 May 2018 01:56:15 +0000 (21:56 -0400)]
tests: fix tests related to test_prog

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

6 years agodoc/commands: term handles `commands_main`
Alexandre Terrasa [Wed, 2 May 2018 23:34:43 +0000 (19:34 -0400)]
doc/commands: term handles `commands_main`

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

6 years agodoc/commands: render `commands_main` as JSON
Alexandre Terrasa [Wed, 2 May 2018 23:20:39 +0000 (19:20 -0400)]
doc/commands: render `commands_main` as JSON

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

6 years agodoc/commands: render `commands_main` as HTML
Alexandre Terrasa [Wed, 2 May 2018 23:20:19 +0000 (19:20 -0400)]
doc/commands: render `commands_main` as HTML

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

6 years agodoc/commands: parse `commands_main`
Alexandre Terrasa [Wed, 2 May 2018 23:18:04 +0000 (19:18 -0400)]
doc/commands: parse `commands_main`

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

6 years agodoc/commands: introduce `commands_main`, commands about main programs
Alexandre Terrasa [Wed, 2 May 2018 23:17:26 +0000 (19:17 -0400)]
doc/commands: introduce `commands_main`, commands about main programs

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

6 years agolib/crypto: add in-place xor cipher on CStrings
Lucas Bajolet [Thu, 10 May 2018 18:18:49 +0000 (14:18 -0400)]
lib/crypto: add in-place xor cipher on CStrings

The xor operation as defined in xor_ciphers lacked a performance-aware
version on byte sequences.

This commit adds a fast version to perform it on a CString.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agolib/core/text: add memset to `CString`
Lucas Bajolet [Thu, 10 May 2018 18:17:39 +0000 (14:17 -0400)]
lib/core/text: add memset to `CString`

Memset is an operation used for setting bytes to a particular value.

Since it was not defined on CStrings, we add it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agolib: manually add `package.desc` keys to some packages
Alexandre Terrasa [Thu, 10 May 2018 16:37:24 +0000 (12:37 -0400)]
lib: manually add `package.desc` keys to some packages

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

6 years agolib: generate `package.desc` keys to all packages
Alexandre Terrasa [Thu, 10 May 2018 16:31:08 +0000 (12:31 -0400)]
lib: generate `package.desc` keys to all packages

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

6 years agodoc/commands: allow NitUnit entities in model view
Alexandre Terrasa [Wed, 2 May 2018 23:19:49 +0000 (19:19 -0400)]
doc/commands: allow NitUnit entities in model view

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

6 years agomodel_collect: collect all mmodules for a mgroup
Alexandre Terrasa [Mon, 7 May 2018 21:02:21 +0000 (17:02 -0400)]
model_collect: collect all mmodules for a mgroup

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

6 years agotests/test_prog: add a dummy test suite
Alexandre Terrasa [Wed, 2 May 2018 23:16:30 +0000 (19:16 -0400)]
tests/test_prog: add a dummy test suite

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

6 years agotests/test_prog: add a dummy man page
Alexandre Terrasa [Wed, 2 May 2018 23:16:20 +0000 (19:16 -0400)]
tests/test_prog: add a dummy man page

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

6 years agoMerge: src/nit: remove unused primitive_types module
Jean Privat [Wed, 9 May 2018 00:03:17 +0000 (20:03 -0400)]
Merge: src/nit: remove unused primitive_types module

The primitive_types module contained legacy native file IO methods which
were unused in the current interpreter.

Since it is not necessary anymore, we remove it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2660

6 years agoMerge: lib/actors: uniformize Makefile names with the rest of the Nit project
Jean Privat [Wed, 9 May 2018 00:02:55 +0000 (20:02 -0400)]
Merge: lib/actors: uniformize Makefile names with the rest of the Nit project

Some of the `actors` Makefile where named `makefile`, this looks weird compared to all others Makefiles in the Nit project.

This PR renames them.

Pull-Request: #2661

6 years agoMerge: doc/commands: introduce INI commands
Jean Privat [Wed, 9 May 2018 00:02:42 +0000 (20:02 -0400)]
Merge: doc/commands: introduce INI commands

This PR introduces commands related to `package.ini` files:
* `CmdIniDescription`: return the package description from the `package.ini` file
* `CmdIniGitUrl`: return the package Git URL from the `package.ini` file
* `CmdIniCloneCommand`: return the package `git clone` command from the `package.ini` file
* `CmdIniIssuesUrl`: return the package issues URL from the `package.ini` file
* `CmdIniMaintainer`: return the maintainer name from the `package.ini` file
* `CmdIniContributors`: return the contributors list from the `package.ini` file
* `CmdIniLicense`: return the license string from the `package.ini` file
* `CmdLicenseFile` and `CmdLicenseFileContent`: return the LICENSE.md file and its content
* `CmdContribFile` and `CmdContribFileContent`: return the CONTRIBUTING.md file and its content

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

6 years agoMerge: nitpackage: generate ini files
Jean Privat [Wed, 9 May 2018 00:02:34 +0000 (20:02 -0400)]
Merge: nitpackage: generate ini files

This PR replace the old `nit-makepackage` sheel script by an option in the `nitpackage` tool.

`nitpackage` is now able to generate `package.ini` files automatically with the following command:

```sh
nitpackage lib/ --gen-ini
```

As examples, I provide two generated ini files:
* `lib/fca/package.ini`
* `lib/vsm/package.ini`

Both file were generated with `nitpackage`, I only edited manually the `tags` and `desc` keys.

Please ignore the three first commits as they belong to #2652.

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

6 years agoMerge: lib/ini: better output
Jean Privat [Wed, 9 May 2018 00:02:31 +0000 (20:02 -0400)]
Merge: lib/ini: better output

This PR changes three things:
* remove `nullable` warnings
* keep the keys in the same order than they are added to the config file
* group keys in the ini output

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

6 years agojson: rename and improve the quick and easy `deserialize_json`
Alexis Laferrière [Tue, 8 May 2018 23:52:02 +0000 (19:52 -0400)]
json: rename and improve the quick and easy `deserialize_json`

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

6 years agotests: fix test for `test_sort_perf`
Alexandre Terrasa [Tue, 8 May 2018 01:36:28 +0000 (21:36 -0400)]
tests: fix test for `test_sort_perf`

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

6 years agonitweb: remove old and useless `doc` view
Alexandre Terrasa [Wed, 2 May 2018 23:41:45 +0000 (19:41 -0400)]
nitweb: remove old and useless `doc` view

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

6 years agonitweb: add HTML view for ini commands
Alexandre Terrasa [Wed, 2 May 2018 23:41:26 +0000 (19:41 -0400)]
nitweb: add HTML view for ini commands

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

6 years agonitweb: serve routes for ini commands
Alexandre Terrasa [Wed, 2 May 2018 23:41:03 +0000 (19:41 -0400)]
nitweb: serve routes for ini commands

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

6 years agodoc/commands: term handles `commands_ini`
Alexandre Terrasa [Wed, 2 May 2018 23:40:42 +0000 (19:40 -0400)]
doc/commands: term handles `commands_ini`

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

6 years agodoc/commands: render `commands_ini` as JSON
Alexandre Terrasa [Wed, 2 May 2018 23:40:23 +0000 (19:40 -0400)]
doc/commands: render `commands_ini` as JSON

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

6 years agodoc/commands: render `commands_ini` as HTML
Alexandre Terrasa [Wed, 2 May 2018 23:40:06 +0000 (19:40 -0400)]
doc/commands: render `commands_ini` as HTML

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

6 years agodoc/commands: parse `commands_ini`
Alexandre Terrasa [Wed, 2 May 2018 23:39:39 +0000 (19:39 -0400)]
doc/commands: parse `commands_ini`

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

6 years agodoc/commands: introduce `commands_ini` for .INI related commands
Alexandre Terrasa [Wed, 2 May 2018 23:39:14 +0000 (19:39 -0400)]
doc/commands: introduce `commands_ini` for .INI related commands

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

6 years agonitpackage: update man page
Alexandre Terrasa [Mon, 7 May 2018 20:31:19 +0000 (16:31 -0400)]
nitpackage: update man page

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

6 years agonitpackage: add option to check existing package.ini files
Alexandre Terrasa [Tue, 8 May 2018 00:51:58 +0000 (20:51 -0400)]
nitpackage: add option to check existing package.ini files

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

6 years agolib/popcorn: remove unknown ini key `version`
Alexandre Terrasa [Tue, 8 May 2018 00:47:34 +0000 (20:47 -0400)]
lib/popcorn: remove unknown ini key `version`

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

6 years agolib: update INI files with for expanded paths
Alexandre Terrasa [Tue, 8 May 2018 00:45:18 +0000 (20:45 -0400)]
lib: update INI files with for expanded paths

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

6 years agolib: generate missing INI files with `nitpackage`
Alexandre Terrasa [Mon, 7 May 2018 19:35:32 +0000 (15:35 -0400)]
lib: generate missing INI files with `nitpackage`

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

6 years agonitpackage: generate INI files
Alexandre Terrasa [Mon, 7 May 2018 17:57:06 +0000 (13:57 -0400)]
nitpackage: generate INI files

Also remove the old shell script `nit-makepackage`

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

6 years agomodel/mpackage: introduce INI path related services
Alexandre Terrasa [Mon, 7 May 2018 17:56:44 +0000 (13:56 -0400)]
model/mpackage: introduce INI path related services

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

6 years agonitpackage: make package expension optional
Alexandre Terrasa [Mon, 7 May 2018 17:54:40 +0000 (13:54 -0400)]
nitpackage: make package expension optional

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

6 years agolib/actors: uniformize Makefile names with the rest of the Nit project
Alexandre Terrasa [Tue, 8 May 2018 02:47:38 +0000 (22:47 -0400)]
lib/actors: uniformize Makefile names with the rest of the Nit project

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

6 years agosrc/nit: remove unused primitive_types module
Lucas Bajolet [Tue, 8 May 2018 15:00:21 +0000 (11:00 -0400)]
src/nit: remove unused primitive_types module

The primitive_types module contained legacy native file IO methods which
were unused in the current interpreter.

Since it is not necessary anymore, we remove it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agonitpackage: only work on packages passed as argument
Alexandre Terrasa [Mon, 7 May 2018 17:53:15 +0000 (13:53 -0400)]
nitpackage: only work on packages passed as argument

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

6 years agonitpackage: move package path services up to `model/mpackage.nit`
Alexandre Terrasa [Mon, 7 May 2018 17:51:54 +0000 (13:51 -0400)]
nitpackage: move package path services up to `model/mpackage.nit`

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

6 years agolib/ini: write output with groups
Alexandre Terrasa [Mon, 7 May 2018 19:28:44 +0000 (15:28 -0400)]
lib/ini: write output with groups

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

6 years agolib/ini: remove warnings
Alexandre Terrasa [Mon, 7 May 2018 19:13:17 +0000 (15:13 -0400)]
lib/ini: remove warnings

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

6 years agolib/ini: write output with groups
Alexandre Terrasa [Mon, 7 May 2018 19:28:44 +0000 (15:28 -0400)]
lib/ini: write output with groups

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

6 years agolib/ini: remove warnings
Alexandre Terrasa [Mon, 7 May 2018 19:13:17 +0000 (15:13 -0400)]
lib/ini: remove warnings

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

6 years agoMerge: Nitcatalog for nitpm
Jean Privat [Mon, 7 May 2018 23:57:32 +0000 (19:57 -0400)]
Merge: Nitcatalog for nitpm

This move the packages fetched by nitpm to nitlanguage.org and use the nitcatalog infrastructure to publish and update the ini files.

The list of public packages is now in `contrig/nitpm_packages.txt` (was `oot.txt`) and new public packages can be added to the file trough PR and review by the community.

Note that there is nothing yet to check the sanity of public pagkage (nor do any long run quality assurance).

Pull-Request: #2650
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: pnacl: remove target and related projects
Jean Privat [Mon, 7 May 2018 23:57:31 +0000 (19:57 -0400)]
Merge: pnacl: remove target and related projects

Since PNaCl is now deprecated for all targets, and since nobody use the
platform or the contributed online_ide, we remove the packages from the
repo.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2651

6 years agoMerge: share/man: update man page for nitweb
Jean Privat [Mon, 7 May 2018 23:57:30 +0000 (19:57 -0400)]
Merge: share/man: update man page for nitweb

This PR fixes the warning thrown by check-manpages.sh for the `nitweb` tool.

Pull-Request: #2654

6 years agotests/test_prog: add dummy documentation
Alexandre Terrasa [Wed, 2 May 2018 23:37:54 +0000 (19:37 -0400)]
tests/test_prog: add dummy documentation

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

6 years agoshare/man: update man page for nitweb
Alexandre Terrasa [Mon, 7 May 2018 20:34:56 +0000 (16:34 -0400)]
share/man: update man page for nitweb

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

6 years agocontrib: add an official nitpm_packages.txt list of repositories
Jean Privat [Mon, 7 May 2018 17:56:17 +0000 (13:56 -0400)]
contrib: add an official nitpm_packages.txt list of repositories

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

6 years agopnacl: remove target and related projects
Lucas Bajolet [Mon, 7 May 2018 16:39:12 +0000 (12:39 -0400)]
pnacl: remove target and related projects

Since PNaCl is now deprecated for all targets, and since nobody use the
platform or the contributed online_ide, we remove the packages from the
repo.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agocontrib/oot.sh: the name is optional (if guessable from the reponame)
Jean Privat [Mon, 7 May 2018 15:53:48 +0000 (11:53 -0400)]
contrib/oot.sh: the name is optional (if guessable from the reponame)

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

6 years agonitpm: use the inifiles exposed by the nit catalog
Jean Privat [Mon, 7 May 2018 16:30:49 +0000 (12:30 -0400)]
nitpm: use the inifiles exposed by the nit catalog

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

6 years agonitcatalog: copy the ini files in p/name.ini
Jean Privat [Mon, 7 May 2018 16:30:19 +0000 (12:30 -0400)]
nitcatalog: copy the ini files in p/name.ini

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

6 years agoMerge: lib/socket: fix socket_c documentation
Jean Privat [Mon, 7 May 2018 12:47:59 +0000 (08:47 -0400)]
Merge: lib/socket: fix socket_c documentation

The socket_c module contained a lot of undocumented functions and
classes, which in turn caused nitpick to be too verbous on subsequent
modules when editing.

This commit fixes all the documentation warnings left in the module.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2643

6 years agolib/socket: fix socket documentation
Lucas Bajolet [Wed, 2 May 2018 19:18:07 +0000 (15:18 -0400)]
lib/socket: fix socket documentation

The socket modules contained a lot of undocumented functions and
classes, which in turn caused nitpick to be too verbous on subsequent
modules when editing.

This commit fixes all the documentation warnings left in the modules.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agoMerge: lib: expand packages
Jean Privat [Fri, 4 May 2018 19:37:05 +0000 (15:37 -0400)]
Merge: lib: expand packages

I'm currently working on generating README files for packages that don't already have one.
The first step is to create a directory for each package (I call it *expanding* the package).

In this PR, I move all singleton packages to their own directory:
* `lib/a_star.nit` --> `lib/a_star/a_star.nit`
* `lib/x11.nit` --> `lib/x11/x11.nit`
* ...

The `package.ini` file is also moved and renamed.

I used the `nitreadme` bin to do that:

~~~sh
nitreadme --expand lib/
~~~

Next step will be to create the README.md file into the newly created directory.

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

6 years agoMerge: doc/commands: introduce CmdEntityLink command
Jean Privat [Fri, 4 May 2018 19:37:03 +0000 (15:37 -0400)]
Merge: doc/commands: introduce CmdEntityLink command

This PR introduce the CmdEntityLink command.

The link command is used to create a link from the generated documentation file to an external resource.

Command forms:
* `[[popcorn]]` generates a link to the `popcorn` package documentation resource.
* `[[popcorn | text: foo, title: bar]]` allows customization of link text and title.

The resource URL depends on the tool.

For example:
* `nitweb` (when the command is used in `docdown` or in a `README`) renders a link to the HTML documentation page on the server
* `nitdoc` (TODO) renders a link to the static documentation page
* `nitx` replaces the link commands by the comment commands (that contains the file location)

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

6 years agoMerge: Write byte updates
Jean Privat [Fri, 4 May 2018 19:37:01 +0000 (15:37 -0400)]
Merge: Write byte updates

More in the Stream refactor series, this commit adds a low-level byte writing method, to be re-implemented when needed. The read_bytes service can now be defined in writer only, as a wrapper to the lower-level service.

Pull-Request: #2642

6 years agoMerge: doc/commands: add tests for html rendering
Jean Privat [Fri, 4 May 2018 19:37:00 +0000 (15:37 -0400)]
Merge: doc/commands: add tests for html rendering

As mentioned by @R4PaSs in #2641, there is no tests for the HTML rendering of commands.

This PR adds nitunit tests for the `commands_html.nit` module.

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

6 years agoMerge: nitpick: do not warn in not explicitly required modules
Jean Privat [Fri, 4 May 2018 19:36:59 +0000 (15:36 -0400)]
Merge: nitpick: do not warn in not explicitly required modules

The infrastructure was already in toocontext, now nitpick uses it.

Pull-Request: #2645

6 years agoMerge: tests/nitunit: test that private methods are nitunited
Jean Privat [Fri, 4 May 2018 19:36:57 +0000 (15:36 -0400)]
Merge: tests/nitunit: test that private methods are nitunited

The code date from #360

close #1603

Pull-Request: #2646

6 years agoMerge: Remove the binary serialization service
Jean Privat [Fri, 4 May 2018 19:36:56 +0000 (15:36 -0400)]
Merge: Remove the binary serialization service

This PR simply removes the binary::serialization module and its tests. Clients should use `msgpack` instead.

The binary serialization service was mostly a test of the serialization framework, it uses a custom format that is hard to debug, it does not subtype check the data before deserialization, and it has no more clients. In comparison, the msgpack serialization service uses a standardized format, it is debuggable and it is generally more space efficient.

Pull-Request: #2647

6 years agotests: update tests for `c` module
Alexandre Terrasa [Fri, 4 May 2018 16:04:52 +0000 (12:04 -0400)]
tests: update tests for `c` module

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

6 years agotests: add sav for nitpackage
Alexandre Terrasa [Fri, 4 May 2018 16:04:29 +0000 (12:04 -0400)]
tests: add sav for nitpackage

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

6 years agoshare/man: add manpage for `nitpackage`
Alexandre Terrasa [Wed, 2 May 2018 19:59:56 +0000 (15:59 -0400)]
share/man: add manpage for `nitpackage`

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

6 years agolib/: expand all packages in their own directories
Alexandre Terrasa [Tue, 1 May 2018 17:08:26 +0000 (13:08 -0400)]
lib/: expand all packages in their own directories

Using `nitreadme lib/ --expand`

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

6 years agolib/core: add low-level byte writing method
Lucas Bajolet [Tue, 1 May 2018 21:36:06 +0000 (17:36 -0400)]
lib/core: add low-level byte writing method

Akin to the read without overhead, this commit adds a low-level service
to write bytes to a Writer stream.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agobinary: remove the serialization service, clients should use msgpack
Alexis Laferrière [Fri, 4 May 2018 14:54:20 +0000 (10:54 -0400)]
binary: remove the serialization service, clients should use msgpack

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

6 years agotests/nitunit: test that private methods are nitunited
Jean Privat [Fri, 4 May 2018 00:39:32 +0000 (20:39 -0400)]
tests/nitunit: test that private methods are nitunited

The code date from #360

close #1603

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

6 years agoMerge: parse_examples: minor fixes
Jean Privat [Thu, 3 May 2018 23:15:49 +0000 (19:15 -0400)]
Merge: parse_examples: minor fixes

This PR fixes two things:
1. call `visit_all` so statements are all visited
2. also count newly instanciated mclasses

Pull-Request: #2639

6 years agonitpick: do not warn in not explicitly required modules
Jean Privat [Thu, 3 May 2018 19:11:01 +0000 (15:11 -0400)]
nitpick: do not warn in not explicitly required modules

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

6 years agoparse_examples: count new on classes
Alexandre Terrasa [Thu, 3 May 2018 15:20:36 +0000 (11:20 -0400)]
parse_examples: count new on classes

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

6 years agoMerge: No intrude rope stream
Jean Privat [Thu, 3 May 2018 13:46:32 +0000 (09:46 -0400)]
Merge: No intrude rope stream

Two things happening here, in two commits:

* the first commit moves the definition of `decoder` into Stream, and renames it to `codec` since both coding/decoding will be used by streams when dealing with String semantics.
* the second commit removes the `intrude inport ropes` from stream as this was not necessary, and performance-wise did not matter sufficiently to justify this

Pull-Request: #2632
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: Read byte rewrite
Jean Privat [Thu, 3 May 2018 13:44:24 +0000 (09:44 -0400)]
Merge: Read byte rewrite

As part of the stream refactor series, this patches cleanup msgpack a bit and introduce a lower-level `read_byte` implementation on which `read_byte(s)` will rely for reading data from a source.

In the future, the lowest-level interface to read bytes, and the only one required for implementing a new stream will be the `raw_read_byte(s)` functions.

A cleanup of the current streams will be needed for this to be used properly, coming in the next few PRs.

Note: The first two commits have already been submitted under #2632, therefore disregard them for this PR.

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

6 years agoMerge: nitmetrics: metrics about ReadMe files
Jean Privat [Thu, 3 May 2018 13:44:21 +0000 (09:44 -0400)]
Merge: nitmetrics: metrics about ReadMe files

This PR add an option `--readme` to extract metrics about ReadMe / Markdown files.

Running the following command:

~~~sh
nitmetrics --readme tests/test_prog
~~~

Will produce the following output:

~~~md
*** METRICS ***

# ReadMe metrics

 ## package test_prog (test_prog/README.md)
  * has_package 1
  * has_readme 1
  * md_lines 12
  * nb_section 0
  * md_blocks 14
  * BlockParagraph 4
  * BlockUnorderedList 1
  * BlockListItem 4
  * SpanCode 4
  * Image 1
~~~

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

6 years agoMerge: Some lib/graph love
Jean Privat [Thu, 3 May 2018 13:44:19 +0000 (09:44 -0400)]
Merge: Some lib/graph love

I needed an Eulerian circuit so I implemented a quick and dirty one

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

6 years agoMerge: model_collect: collect all modules from a package
Jean Privat [Thu, 3 May 2018 13:44:18 +0000 (09:44 -0400)]
Merge: model_collect: collect all modules from a package

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

Pull-Request: #2638

6 years agoMerge: lib/msgpack: unify several cases for deserialization
Jean Privat [Thu, 3 May 2018 13:44:16 +0000 (09:44 -0400)]
Merge: lib/msgpack: unify several cases for deserialization

Some cases were treated independently while retaining mostly the same
code.

This commit tries to unite such cases into a single branch.

Doing so helps readability, reduces code duplication and should
hopefully improve performance as the number of tests to be performed is
lower.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2640
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agodoc/api: allow entity url customization
Alexandre Terrasa [Wed, 2 May 2018 22:54:55 +0000 (18:54 -0400)]
doc/api: allow entity url customization

Also update tests for HTML since the URLs are different.

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

6 years agodoc/commands: DocDown accept CmdEntityLink commands
Alexandre Terrasa [Tue, 1 May 2018 19:34:51 +0000 (15:34 -0400)]
doc/commands: DocDown accept CmdEntityLink commands

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

6 years agodoc/commands: term accept CmdEntityLink commands
Alexandre Terrasa [Tue, 1 May 2018 19:33:56 +0000 (15:33 -0400)]
doc/commands: term accept CmdEntityLink commands

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

6 years agodoc/commands: do not accept empty CmdEntity names
Alexandre Terrasa [Tue, 1 May 2018 19:33:35 +0000 (15:33 -0400)]
doc/commands: do not accept empty CmdEntity names

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

6 years agodoc/commands: parse CmdEntityLink command strings
Alexandre Terrasa [Tue, 1 May 2018 19:33:14 +0000 (15:33 -0400)]
doc/commands: parse CmdEntityLink command strings

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

6 years agodoc/commands: generate CmdEntityLink command to HTML
Alexandre Terrasa [Tue, 1 May 2018 19:32:43 +0000 (15:32 -0400)]
doc/commands: generate CmdEntityLink command to HTML

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

6 years agodoc/commands: generate CmdEntityLink to JSON
Alexandre Terrasa [Tue, 1 May 2018 19:30:41 +0000 (15:30 -0400)]
doc/commands: generate CmdEntityLink to JSON

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

6 years agodoc/commands: parse CmdEntityLink commands from http
Alexandre Terrasa [Tue, 1 May 2018 19:30:11 +0000 (15:30 -0400)]
doc/commands: parse CmdEntityLink commands from http

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

6 years agodoc/commands: introduce CmdEntityLink command
Alexandre Terrasa [Tue, 1 May 2018 19:29:46 +0000 (15:29 -0400)]
doc/commands: introduce CmdEntityLink command

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