nit.git
8 years agoversion 0.7.9 v0.7.9
Jean Privat [Sat, 31 Oct 2015 14:29:06 +0000 (10:29 -0400)]
version 0.7.9

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

8 years agoMerge: Bench strings update
Jean Privat [Thu, 29 Oct 2015 19:04:02 +0000 (15:04 -0400)]
Merge: Bench strings update

A few things happening here:

* Added some line-producing output to `bench_plot.sh`, use both functions to produce lines instead of histograms
* `bench_strings.sh` underwent a few transformations: now you can try with different values of `maxlen` (threshold at which a flat concatenation produces a new Concat node instead of a new FlatString), you can also work on HEAD only with a new option, also, all benches now produce lines instead of histograms

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

8 years agoMerge: Robust Virtual Type
Jean Privat [Thu, 29 Oct 2015 19:04:00 +0000 (15:04 -0400)]
Merge: Robust Virtual Type

Improve the handling of inconsistent model when virtual types are badly defined.

The changes are mainly done with 2 things:

* still register broken `type` definition in the property, so that properties have at least a definition
* use bottom type (also called the absurd type) to indicate inconsistency in the model (instead of aborting)

Reported-by: @Morriar

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

8 years agoMerge: lib/trees: more services and documentation
Jean Privat [Thu, 29 Oct 2015 19:03:55 +0000 (15:03 -0400)]
Merge: lib/trees: more services and documentation

Add `depth` and `Comparable` services to abstract Trees.

Also enhance the abstract_tree module documentation.

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

8 years agobenches: String benches now produce line graphs, HTML and can be used to test differe...
Lucas Bajolet [Thu, 29 Oct 2015 18:59:22 +0000 (14:59 -0400)]
benches: String benches now produce line graphs, HTML and can be used to test different variations of `maxlen`

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

8 years agobench_plot.sh: Fix indentation in prepare_res
Lucas Bajolet [Thu, 29 Oct 2015 19:00:09 +0000 (15:00 -0400)]
bench_plot.sh: Fix indentation in prepare_res

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

8 years agobench_plot: Added line-producing plot functions
Lucas Bajolet [Wed, 28 Oct 2015 20:16:54 +0000 (16:16 -0400)]
bench_plot: Added line-producing plot functions

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

8 years agoMerge: nitc can inline redefinitions with -D
Jean Privat [Thu, 29 Oct 2015 12:36:46 +0000 (08:36 -0400)]
Merge: nitc can inline redefinitions with -D

nitc with --global and --semi-global tries to inline things, but methods with an explicit `constant_value` (i.e. defined with `-D`) were not recognized when asked: ``can I inline this?''

The inlining itself does not require specific code.

Close #1793

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

8 years agotests: add error_redef_vt
Jean Privat [Wed, 28 Oct 2015 16:06:36 +0000 (12:06 -0400)]
tests: add error_redef_vt

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

8 years agotests: update sav for VT related tests
Jean Privat [Wed, 28 Oct 2015 16:05:20 +0000 (12:05 -0400)]
tests: update sav for VT related tests

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

8 years agomodelize: Gracefully handle virtual types without definition in `check_virtual_types_...
Jean Privat [Wed, 28 Oct 2015 16:04:51 +0000 (12:04 -0400)]
modelize: Gracefully handle virtual types without definition in `check_virtual_types_circularity`

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

8 years agomodelizey: continue processing broken redef virtual type
Jean Privat [Wed, 28 Oct 2015 16:03:33 +0000 (12:03 -0400)]
modelizey: continue processing broken redef virtual type

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

8 years agomodelize_property: use bottom type to mark invalid VT bounds
Jean Privat [Wed, 28 Oct 2015 16:01:35 +0000 (12:01 -0400)]
modelize_property: use bottom type to mark invalid VT bounds

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

8 years agomodel: in case of error, methods of MVirtualType return a bottomtype
Jean Privat [Wed, 28 Oct 2015 15:58:07 +0000 (11:58 -0400)]
model: in case of error, methods of MVirtualType return a bottomtype

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

8 years agomodel: handle BottomType in `is_subtype`
Jean Privat [Wed, 28 Oct 2015 15:50:45 +0000 (11:50 -0400)]
model: handle BottomType in `is_subtype`

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

8 years agotests: test nitc with -D and --semi-global
Jean Privat [Wed, 28 Oct 2015 20:01:47 +0000 (16:01 -0400)]
tests: test nitc with -D and --semi-global

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

8 years agoabstract_compiler: can inline methods with `constant_value` (defined with -D)
Jean Privat [Wed, 28 Oct 2015 19:58:56 +0000 (15:58 -0400)]
abstract_compiler: can inline methods with `constant_value` (defined with -D)

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

8 years agoMerge: examples/shoot: fix typo in shoot_linux synopsys
Jean Privat [Wed, 28 Oct 2015 17:02:50 +0000 (13:02 -0400)]
Merge: examples/shoot: fix typo in shoot_linux synopsys

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

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

8 years agoMerge: introduce nit_env.sh to setup the shell environement
Jean Privat [Wed, 28 Oct 2015 17:02:28 +0000 (13:02 -0400)]
Merge: introduce nit_env.sh to setup the shell environement

The script `nit_env.sh` tries to auto-magically configure PATH, MANPATH and bash completion for users. The point is to be as portable and simple a possible for the final used has he just has to write

~~~
$ source misc/nit_env.sh
~~~

and get a working setup.

Moreover, if `install` in given as argument, then the script register itself to the user `$HOME/.profile`.

~~~
$ source misc/nit_env.sh install
~~~

One advantage is that the script invocation is registered in `.profile`, thus future evolutions of the script will be automatically used in future sessions of the users.

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

8 years agoexamples/shoot: fix typo in shoot_linux synopsys.
Alexandre Terrasa [Tue, 27 Oct 2015 19:08:59 +0000 (15:08 -0400)]
examples/shoot: fix typo in shoot_linux synopsys.

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

8 years agoMakefile: talk about nit_env.sh after successful `make all`
Jean Privat [Thu, 22 Oct 2015 18:12:32 +0000 (14:12 -0400)]
Makefile: talk about nit_env.sh after successful `make all`

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

8 years agoREADME: document nit_env.sh
Jean Privat [Thu, 22 Oct 2015 14:55:34 +0000 (10:55 -0400)]
README: document nit_env.sh

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

8 years agomisc: add `nit_env.sh` to auto-magically configure shell environements
Jean Privat [Thu, 22 Oct 2015 14:53:09 +0000 (10:53 -0400)]
misc: add `nit_env.sh` to auto-magically configure shell environements

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

8 years agoMerge: benitlux: produce better reports
Jean Privat [Mon, 26 Oct 2015 13:55:10 +0000 (09:55 -0400)]
Merge: benitlux: produce better reports

This PR adds customizable width to the graph generated by the benitlux report tool and displays short lived beer batches. Previously, some beers could not appear if they lasted less than a week on the menu.

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

8 years agoMerge: Update readme
Jean Privat [Mon, 26 Oct 2015 13:55:07 +0000 (09:55 -0400)]
Merge: Update readme

Just a refresh on the README content as it is what is shown in github

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

8 years agoMerge: Opportunity: intro ∇ ratio
Jean Privat [Mon, 26 Oct 2015 13:55:04 +0000 (09:55 -0400)]
Merge: Opportunity: intro ∇ ratio

Add the ∇ ratio to Opportunity with a customizable multiplier. It assigns weight to the choices of participants so that someone who select all possible answers puts less weight on each answer, and someone who choses a single answer puts her full weight on it.

It can be used to count the number of pizzas to order (with a multiplier of 0.4) and to give more importances to the available times of busy people when scheduling a meeting.

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

8 years agolib/trees: enhance AbstractTreeNode documentation
Alexandre Terrasa [Fri, 11 Sep 2015 16:58:58 +0000 (12:58 -0400)]
lib/trees: enhance AbstractTreeNode documentation

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

8 years agolib/trees: add generic and usefull services in TreeMapNode
Alexandre Terrasa [Sat, 24 Oct 2015 22:52:14 +0000 (18:52 -0400)]
lib/trees: add generic and usefull services in TreeMapNode

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

8 years agolib/trees: clean whitespaces
Alexandre Terrasa [Thu, 3 Sep 2015 21:47:36 +0000 (17:47 -0400)]
lib/trees: clean whitespaces

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

8 years agocontrib/benitlux: select the width of the report with an argument
Alexis Laferrière [Thu, 24 Sep 2015 21:47:05 +0000 (17:47 -0400)]
contrib/benitlux: select the width of the report with an argument

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

8 years agocontrib/benitlux: report shows beers available between sample days
Alexis Laferrière [Fri, 23 Oct 2015 15:45:59 +0000 (11:45 -0400)]
contrib/benitlux: report shows beers available between sample days

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

8 years agolib: intro Collection::has_any
Alexis Laferrière [Fri, 23 Oct 2015 16:29:58 +0000 (12:29 -0400)]
lib: intro Collection::has_any

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

8 years agoMerge: Less null warnings in src/
Jean Privat [Thu, 22 Oct 2015 18:15:12 +0000 (14:15 -0400)]
Merge: Less null warnings in src/

Some small warning reductions while wandering in the source code of src/

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

8 years agoMerge: More lib/html optimizations
Jean Privat [Thu, 22 Oct 2015 18:15:10 +0000 (14:15 -0400)]
Merge: More lib/html optimizations

Lazily create structures for attributes and children as most HTML nodes do not have them.

User time for `time ./nitlight ../lib -d out`:

* before 0m8.196s
* after 0m6.940s (-15%)

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

8 years agoDeprecate the Changelog.
Jean Privat [Thu, 22 Oct 2015 12:55:33 +0000 (08:55 -0400)]
Deprecate the Changelog.

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

8 years agoupdate root README
Jean Privat [Thu, 22 Oct 2015 12:52:14 +0000 (08:52 -0400)]
update root README

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

8 years agoMakefile: `all` generate manpages as `pandoc` is no more required
Jean Privat [Thu, 22 Oct 2015 14:00:30 +0000 (10:00 -0400)]
Makefile: `all` generate manpages as `pandoc` is no more required

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

8 years agoMerge: Generalize `MModule::is_fictive` to any entity
Jean Privat [Thu, 22 Oct 2015 00:45:44 +0000 (20:45 -0400)]
Merge: Generalize `MModule::is_fictive` to any entity

Extends #1776 (so first commits include them)

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

8 years agoMerge: Cleanup and synchronize options in manpages
Jean Privat [Thu, 22 Oct 2015 00:45:40 +0000 (20:45 -0400)]
Merge: Cleanup and synchronize options in manpages

A tedious work to detect and fix undocumented options in the manpages of tools.
This also synchronizse the description of `--help` and the text in manpages (when there is a diversion, the best one if often selected).

Cherry on the cake: a new script `check_manpage` can automatically check that new options of tools are documented in the man. Close #1772

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

8 years agoMerge: Introduce model_visitor
Jean Privat [Thu, 22 Oct 2015 00:45:37 +0000 (20:45 -0400)]
Merge: Introduce model_visitor

As requested, this is a basic visitor framework on models.
Services names are inspired from those in the AST visitor.

Fell free to comment the API or suggest ideas.

Pull-Request: #1776
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agomodelviz: make the LinexComparator more robust by getting the model from a non-nullab...
Jean Privat [Thu, 22 Oct 2015 00:34:01 +0000 (20:34 -0400)]
modelviz: make the LinexComparator more robust by getting the model from a non-nullable object

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

8 years agomodel_viz: handle groups without filepaths.
Jean Privat [Thu, 22 Oct 2015 00:33:05 +0000 (20:33 -0400)]
model_viz: handle groups without filepaths.

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

8 years agomodel: hint the semantize phases that `exit` does not return
Jean Privat [Thu, 22 Oct 2015 00:32:30 +0000 (20:32 -0400)]
model: hint the semantize phases that `exit` does not return

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

8 years agoniti: protect some NPE errors
Jean Privat [Thu, 22 Oct 2015 00:31:37 +0000 (20:31 -0400)]
niti: protect some NPE errors

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

8 years agoglobal_compiler: remove a useless local variable
Jean Privat [Thu, 22 Oct 2015 00:31:01 +0000 (20:31 -0400)]
global_compiler: remove a useless local variable

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

8 years agosrc: remove some `call on nullable` warning with a non-null local variable
Jean Privat [Thu, 22 Oct 2015 00:30:33 +0000 (20:30 -0400)]
src: remove some `call on nullable` warning with a non-null local variable

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

8 years agoopportunity: intro pizza ratio
Alexis Laferrière [Wed, 21 Oct 2015 22:33:52 +0000 (18:33 -0400)]
opportunity: intro pizza ratio

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

8 years agooppurtunity: focus on #new_name
Alexis Laferrière [Wed, 21 Oct 2015 19:47:47 +0000 (15:47 -0400)]
oppurtunity: focus on #new_name

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

8 years agoopportunity: count entries in JavaScript on load
Alexis Laferrière [Wed, 21 Oct 2015 17:23:36 +0000 (13:23 -0400)]
opportunity: count entries in JavaScript on load

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

8 years agoMerge: remove some unwanted files
Jean Privat [Wed, 21 Oct 2015 21:52:26 +0000 (17:52 -0400)]
Merge: remove some unwanted files

Pull-Request: #1779
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>

8 years agoMerge: Fix `-e` and `-n` on nit
Jean Privat [Wed, 21 Oct 2015 21:52:23 +0000 (17:52 -0400)]
Merge: Fix `-e` and `-n` on nit

These options where broken, and nobody complained.
Now they works again.

Pull-Request: #1777
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agomodel_visitor: skip fictive entities by default
Jean Privat [Wed, 21 Oct 2015 20:30:08 +0000 (16:30 -0400)]
model_visitor: skip fictive entities by default

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

8 years agomodelize: special lazy attribute is tagged fictive
Jean Privat [Wed, 21 Oct 2015 20:29:19 +0000 (16:29 -0400)]
modelize: special lazy attribute is tagged fictive

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

8 years agomodel: move-up `is_fictive` from MModule to MEntity
Jean Privat [Wed, 21 Oct 2015 20:20:40 +0000 (16:20 -0400)]
model: move-up `is_fictive` from MModule to MEntity

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

8 years agotests: skip test_model_visitor on nitc --global
Jean Privat [Tue, 20 Oct 2015 23:48:04 +0000 (19:48 -0400)]
tests: skip test_model_visitor on nitc --global

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

8 years agosrc/nituml: fix `Model::tpl_*` since it is now a MEntity
Jean Privat [Tue, 20 Oct 2015 22:24:36 +0000 (18:24 -0400)]
src/nituml: fix `Model::tpl_*` since it is now a MEntity

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

8 years agosrc: add test_model_visitor
Jean Privat [Tue, 20 Oct 2015 18:13:46 +0000 (14:13 -0400)]
src: add test_model_visitor

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

8 years agomodel_visitor: can filter on visibility
Jean Privat [Tue, 20 Oct 2015 18:10:48 +0000 (14:10 -0400)]
model_visitor: can filter on visibility

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

8 years agomodel: introduce `model_visitor` as a basic model visiting framework.
Jean Privat [Tue, 20 Oct 2015 18:10:08 +0000 (14:10 -0400)]
model: introduce `model_visitor` as a basic model visiting framework.

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

8 years agotests: update sav/test_toolcontext_args2.res with new descriptions of options
Jean Privat [Wed, 21 Oct 2015 12:58:50 +0000 (08:58 -0400)]
tests: update sav/test_toolcontext_args2.res with new descriptions of options

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

8 years agonitdoc: cleanup and synchronize nitdoc options from #1771
Jean Privat [Wed, 21 Oct 2015 12:57:01 +0000 (08:57 -0400)]
nitdoc: cleanup and synchronize nitdoc options from #1771

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

8 years agonitx: rename option `--query` to `--command`
Jean Privat [Wed, 21 Oct 2015 12:50:42 +0000 (08:50 -0400)]
nitx: rename option `--query` to `--command`

`-q` conflicts with `--quiet` from toolcontext.
Moreover, the documentation talks about commands, not queries,
so this unify the vocabulary.

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

8 years agojenkins: add a script to check options in manpages
Jean Privat [Wed, 21 Oct 2015 02:39:22 +0000 (22:39 -0400)]
jenkins: add a script to check options in manpages

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

8 years agolib/html: make `children` lazy
Jean Privat [Wed, 21 Oct 2015 14:57:41 +0000 (10:57 -0400)]
lib/html: make `children` lazy

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

8 years agolib/html: make `attrs`, `classes` and `css_props` lazy.
Jean Privat [Wed, 21 Oct 2015 14:57:16 +0000 (10:57 -0400)]
lib/html: make `attrs`, `classes` and `css_props` lazy.

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

8 years agoMerge: lib/serialization: fix deserialization constructor calling the default init
Jean Privat [Wed, 21 Oct 2015 13:03:23 +0000 (09:03 -0400)]
Merge: lib/serialization: fix deserialization constructor calling the default init

Restore previous behavior of the deserialization init which should not call the default init. This caused problems on default inits that accessed not yet deserialized attributes.

This also fixes WBTW troubles with game saving and multiplayer.

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

8 years agonitpick: hide `--vim-autocomplete` from the help
Jean Privat [Wed, 21 Oct 2015 02:36:02 +0000 (22:36 -0400)]
nitpick: hide `--vim-autocomplete` from the help

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

8 years agoother tools: cleanup and synchronize options with the manpage
Jean Privat [Wed, 21 Oct 2015 02:34:41 +0000 (22:34 -0400)]
other tools: cleanup and synchronize options with the manpage

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

8 years agonitc: cleanup and synchronize options with the manpage
Jean Privat [Wed, 21 Oct 2015 02:31:40 +0000 (22:31 -0400)]
nitc: cleanup and synchronize options with the manpage

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

8 years agonitx: add the missing options `--no-attributes` and `--private`
Jean Privat [Wed, 21 Oct 2015 02:29:32 +0000 (22:29 -0400)]
nitx: add the missing options `--no-attributes` and `--private`

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

8 years agoman/nitserial.md: add mission option `--depth`
Jean Privat [Wed, 21 Oct 2015 02:28:44 +0000 (22:28 -0400)]
man/nitserial.md: add mission option `--depth`

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

8 years agoman/nitpretty.md: add missing options `-line-width` and `--no-inline`
Jean Privat [Wed, 21 Oct 2015 02:28:11 +0000 (22:28 -0400)]
man/nitpretty.md: add missing options `-line-width` and `--no-inline`

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

8 years agoman/nitpick.md: add missing option `--vim-autocomplete`
Jean Privat [Wed, 21 Oct 2015 02:27:35 +0000 (22:27 -0400)]
man/nitpick.md: add missing option `--vim-autocomplete`

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

8 years agoman/nitmetrics.md: add missing `--detect-covariance`
Jean Privat [Wed, 21 Oct 2015 02:27:08 +0000 (22:27 -0400)]
man/nitmetrics.md: add missing `--detect-covariance`

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

8 years agonitls: rename `--path` to `--path-only` to avoid conflict with `-I`
Jean Privat [Wed, 21 Oct 2015 02:26:29 +0000 (22:26 -0400)]
nitls: rename `--path` to `--path-only` to avoid conflict with `-I`

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

8 years agoman/nitc.md: add missing options
Jean Privat [Wed, 21 Oct 2015 02:24:54 +0000 (22:24 -0400)]
man/nitc.md: add missing options

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

8 years agorm lib/core/collection/m.dot that was wrongly commited in 39fcf4a75aae
Jean Privat [Wed, 21 Oct 2015 02:56:50 +0000 (22:56 -0400)]
rm lib/core/collection/m.dot that was wrongly commited in 39fcf4a75aae

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

8 years agoremove .hgignore that is deprecated since eons
Jean Privat [Wed, 21 Oct 2015 02:51:00 +0000 (22:51 -0400)]
remove .hgignore that is deprecated since eons

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

8 years agoMerge: lib/core: Optimized `html_escape` for FlatText variants
Jean Privat [Wed, 21 Oct 2015 01:10:06 +0000 (21:10 -0400)]
Merge: lib/core: Optimized `html_escape` for FlatText variants

As @privat requested, a byte-oriented optimized version of `FlatText` for `FlatString` as it is the most common case, like `escape_to_c`, it works at the byte level to accelerate fetching of characters.

On a short test program

~~~nit
var s = ""
for i in [0 .. 2000[ do s = "&lt;STRING&#47;&rt;".html_escape
~~~

Valgrind reports an old runtime of 18.208 MIr with a 8856 Ir/call to `html_escape`; the new runtime is 3.093 MIr, which translates to a 1298 Ir/call.

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

8 years agoMerge: lib/core: Added new `hexdigest` service on `Text`
Jean Privat [Wed, 21 Oct 2015 01:10:04 +0000 (21:10 -0400)]
Merge: lib/core: Added new `hexdigest` service on `Text`

Title says all, I needed this today to debug trailing zeroes in a produced string and I figured it could be PR'd

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

8 years agoMerge: loader: print error if bad files given to `scan_full` or `parse_full`
Jean Privat [Wed, 21 Oct 2015 01:10:02 +0000 (21:10 -0400)]
Merge: loader: print error if bad files given to `scan_full` or `parse_full`

The last series (#1750 ) removed then silently.

A test is also added to avoid regression.

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

8 years agoMerge: nitdoc: opts --no-render and --test
Jean Privat [Wed, 21 Oct 2015 01:10:00 +0000 (21:10 -0400)]
Merge: nitdoc: opts --no-render and --test

Juste cleaning some options.

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

8 years agoRevert "tests: update deserializations tests with nitce because fixed autoinit fix...
Alexis Laferrière [Wed, 21 Oct 2015 00:23:16 +0000 (20:23 -0400)]
Revert "tests: update deserializations tests with nitce because fixed autoinit fix things"

This reverts commit 61d0c58a7bc53d6086e873fb4dd7d13cc985ca66.

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

8 years agotests: test `-e` and `-n` for the nit interpreter
Jean Privat [Tue, 20 Oct 2015 22:08:07 +0000 (18:08 -0400)]
tests: test `-e` and `-n` for the nit interpreter

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

8 years agolib/niti_runtime: update to reflect not-so-recent changes on eof and readline
Jean Privat [Tue, 20 Oct 2015 20:43:21 +0000 (16:43 -0400)]
lib/niti_runtime: update to reflect not-so-recent changes on eof and readline

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

8 years agoloader: add result of `load_rt_module` in the list of parsed modules
Jean Privat [Tue, 20 Oct 2015 20:38:07 +0000 (16:38 -0400)]
loader: add result of `load_rt_module` in the list of parsed modules

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

8 years agoloader: do not crash in `search_mmodule_by_name` if anode is null
Jean Privat [Tue, 20 Oct 2015 20:37:22 +0000 (16:37 -0400)]
loader: do not crash in `search_mmodule_by_name` if anode is null

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

8 years agomodel: make `Model` a `MEntity` to enable the semi-composite design pattern.
Jean Privat [Tue, 20 Oct 2015 18:08:57 +0000 (14:08 -0400)]
model: make `Model` a `MEntity` to enable the semi-composite design pattern.

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

8 years agolib/core: Optimized `html_escape` for FlatText variants
Lucas Bajolet [Tue, 20 Oct 2015 17:47:49 +0000 (13:47 -0400)]
lib/core: Optimized `html_escape` for FlatText variants

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

8 years agolib/core: Added new `hexdigest` service on `Text`
Lucas Bajolet [Tue, 20 Oct 2015 15:37:47 +0000 (11:37 -0400)]
lib/core: Added new `hexdigest` service on `Text`

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

8 years agoMerge: Optimize hash collection
Jean Privat [Tue, 20 Oct 2015 02:32:54 +0000 (22:32 -0400)]
Merge: Optimize hash collection

Some optimization when dealing with empty hash-based collection

user time for nitc nitc.nit:

* before: 0m6.640s
* after: 0m6.344s (-4.5%)

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

8 years agoloader: print error if bad files given to `scan_full` or `parse_full`
Jean Privat [Tue, 20 Oct 2015 00:44:25 +0000 (20:44 -0400)]
loader: print error if bad files given to `scan_full` or `parse_full`

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

8 years agoMerge: lib: Introduce Stanford CoreNLP wrapper
Jean Privat [Tue, 20 Oct 2015 00:24:12 +0000 (20:24 -0400)]
Merge: lib: Introduce Stanford CoreNLP wrapper

## Stanford Core NLP

Stanford CoreNLP provides a set of natural language analysis tools which can take
raw text input and give the base forms of words, their parts of speech, whether
they are names of companies, people, etc., normalize dates, times, and numeric
quantities, and mark up the structure of sentences in terms of phrases and word
dependencies, indicate which noun phrases refer to the same entities, indicate
sentiment, etc.

This wrapper needs the Stanford CoreNLP jars that run on Java 1.8+.

See http://nlp.stanford.edu/software/corenlp.shtml.

## Usage

~~~nit
var proc = new NLPProcessor("path/to/StanfordCoreNLP/jars")

var doc = proc.process("String to analyze")

for sentence in doc.sentences do
for token in sentence.tokens do
print "{token.lemma}: {token.pos}"
end
end
~~~

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

8 years agoMerge: parser: do not allocate a reduction table for each parser
Jean Privat [Tue, 20 Oct 2015 00:23:44 +0000 (20:23 -0400)]
Merge: parser: do not allocate a reduction table for each parser

This optimize multiple Parser allocation, for instance nitunit or nitdoc that need to deal with each nitunit in the documentation.

usertime for `./nitdoc ../lib/core/`:

* before: 0m2.184s
* after: 0m1.788s (-18.1%)

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

8 years agoMerge: lib/html: implement the tag list as an hashset instead of a array.
Jean Privat [Tue, 20 Oct 2015 00:23:37 +0000 (20:23 -0400)]
Merge: lib/html: implement the tag list as an hashset instead of a array.

This optimize clients of lib/html like highlight.

usertime for `./test_highlight ../lib/core/`:

* before: 0m2.416s
* after: 0m2.328s (-3.64%)

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

8 years agohash_debug: monitor calls to `enlarge`
Jean Privat [Tue, 20 Oct 2015 00:21:26 +0000 (20:21 -0400)]
hash_debug: monitor calls to `enlarge`

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

8 years agocore::hash_collection: simplify `enlarge`
Jean Privat [Tue, 20 Oct 2015 00:19:12 +0000 (20:19 -0400)]
core::hash_collection: simplify `enlarge`

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

8 years agocore::hash_collection: native array storage is no more nullable
Jean Privat [Tue, 20 Oct 2015 00:04:52 +0000 (20:04 -0400)]
core::hash_collection: native array storage is no more nullable

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

8 years agocore::hash_collection: do not allocate the storage, wait for the first `store`.
Jean Privat [Tue, 20 Oct 2015 00:04:11 +0000 (20:04 -0400)]
core::hash_collection: do not allocate the storage, wait for the first `store`.

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

8 years agosrc/doc: move the testing option to its own doc_phase.
Alexandre Terrasa [Mon, 19 Oct 2015 23:01:20 +0000 (19:01 -0400)]
src/doc: move the testing option to its own doc_phase.

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