nit.git
7 years agoNOTICE: Fix years
Jean-Christophe Beaupré [Thu, 30 Jun 2016 13:46:53 +0000 (09:46 -0400)]
NOTICE: Fix years

There is at least one commit from @calestar in 2008.

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

7 years agoMerge: tests: add sav/Darwin/test_loader_args5.res
Jean Privat [Wed, 6 Jul 2016 13:23:12 +0000 (09:23 -0400)]
Merge: tests: add sav/Darwin/test_loader_args5.res

because /lib does not exists

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

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

7 years agotests: add sav/Darwin/test_loader_args5.res
Jean Privat [Mon, 4 Jul 2016 20:18:44 +0000 (16:18 -0400)]
tests: add sav/Darwin/test_loader_args5.res

because /lib does not exists

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

7 years agoMerge: model: Fix a spelling mistake
Jean Privat [Mon, 4 Jul 2016 19:16:55 +0000 (15:16 -0400)]
Merge: model: Fix a spelling mistake

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

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

7 years agoMerge: model: Write errors to stderr
Jean Privat [Mon, 4 Jul 2016 19:16:54 +0000 (15:16 -0400)]
Merge: model: Write errors to stderr

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

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

7 years agoMerge: nitweb: stars rating system
Jean Privat [Mon, 4 Jul 2016 19:16:52 +0000 (15:16 -0400)]
Merge: nitweb: stars rating system

Add discrete stars rating system in top right corner of each documentation card.

Can be seen here: http://nitweb.moz-code.org/doc/core::Array

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

7 years agonitweb/angular: do not use intro mdoc
Alexandre Terrasa [Thu, 30 Jun 2016 02:35:41 +0000 (22:35 -0400)]
nitweb/angular: do not use intro mdoc

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

7 years agonitweb/angular: display stars
Alexandre Terrasa [Thu, 30 Jun 2016 02:35:24 +0000 (22:35 -0400)]
nitweb/angular: display stars

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

7 years agoMerge: nitwebcrawl: add a simple crawler for nitweb
Jean Privat [Mon, 4 Jul 2016 15:26:31 +0000 (11:26 -0400)]
Merge: nitwebcrawl: add a simple crawler for nitweb

I do not remember why I developed this, but it works so why not publish it.

This can be a base to bench IO-bound parallel problem, or something to test nitweb.
For information, if I crawl a nitweb server on lib/core. I get 5209 entities in 1m51s real time (0m50s user time)

Pull-Request: #2214
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

7 years agoMerge: model: Fix a minor documentation mistake
Jean Privat [Mon, 4 Jul 2016 15:26:30 +0000 (11:26 -0400)]
Merge: model: Fix a minor documentation mistake

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

Pull-Request: #2213

7 years agoMerge: model_collect: Fix a spelling mistake
Jean Privat [Mon, 4 Jul 2016 15:26:28 +0000 (11:26 -0400)]
Merge: model_collect: Fix a spelling mistake

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

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

7 years agonitwebcrawl: add a simple crawler for nitweb
Jean Privat [Mon, 4 Jul 2016 15:25:02 +0000 (11:25 -0400)]
nitwebcrawl: add a simple crawler for nitweb

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

7 years agomodel: Fix a spelling mistake
Jean-Christophe Beaupré [Mon, 4 Jul 2016 15:14:35 +0000 (11:14 -0400)]
model: Fix a spelling mistake

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

7 years agomodel: Write errors to stderr
Jean-Christophe Beaupré [Mon, 4 Jul 2016 14:13:31 +0000 (10:13 -0400)]
model: Write errors to stderr

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

7 years agomodel: Fix an error message
Jean-Christophe Beaupré [Mon, 4 Jul 2016 14:12:03 +0000 (10:12 -0400)]
model: Fix an error message

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

7 years agomodel: Fix a minor documentation mistake
Jean-Christophe Beaupré [Thu, 30 Jun 2016 16:53:51 +0000 (12:53 -0400)]
model: Fix a minor documentation mistake

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

7 years agomodel_collect: Fix a spelling mistake
Jean-Christophe Beaupré [Thu, 30 Jun 2016 15:36:13 +0000 (11:36 -0400)]
model_collect: Fix a spelling mistake

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

7 years agoMerge: modelize_class: Fix a verb tense
Jean Privat [Thu, 30 Jun 2016 14:31:54 +0000 (10:31 -0400)]
Merge: modelize_class: Fix a verb tense

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

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

7 years agoMerge: model: Fix minor documentation mistakes
Jean Privat [Thu, 30 Jun 2016 14:31:51 +0000 (10:31 -0400)]
Merge: model: Fix minor documentation mistakes

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

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

7 years agoMerge: lib/core: Push rope maxlen to 512 instead of 64
Jean Privat [Thu, 30 Jun 2016 14:31:13 +0000 (10:31 -0400)]
Merge: lib/core: Push rope maxlen to 512 instead of 64

As discussed in my thesis, 512 bytes/leaf is a nice compromise for most uses of Ropes, therefore, the current threshold is updated to better reflect this.

Pull-Request: #2208

7 years agomodelize_class: Fix a verb tense
Jean-Christophe Beaupré [Thu, 30 Jun 2016 14:30:14 +0000 (10:30 -0400)]
modelize_class: Fix a verb tense

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

7 years agomodel: Fix minor documentation mistakes
Jean-Christophe Beaupré [Thu, 30 Jun 2016 14:17:49 +0000 (10:17 -0400)]
model: Fix minor documentation mistakes

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

7 years agonitweb: introduce feedback API for star rating system
Alexandre Terrasa [Thu, 30 Jun 2016 02:34:53 +0000 (22:34 -0400)]
nitweb: introduce feedback API for star rating system

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

7 years agoweb: rename `model_api` into `api_model`
Alexandre Terrasa [Thu, 30 Jun 2016 00:43:35 +0000 (20:43 -0400)]
web: rename `model_api` into `api_model`

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

7 years agolib/core: Push rope maxlen to 512 instead of 64
Lucas Bajolet [Wed, 29 Jun 2016 17:20:34 +0000 (13:20 -0400)]
lib/core: Push rope maxlen to 512 instead of 64

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

7 years agoMerge: Lighter strings
Jean Privat [Wed, 29 Jun 2016 13:57:48 +0000 (09:57 -0400)]
Merge: Lighter strings

This is an attempt to make text variants substantially lighter by adding cost to certain rare operations.
With this PR:

* `to_cstring` is not cached anymore, this induces more freedom on the FFI-side of things since the copy will be done on site, therefore the `char*` is now mutable on this side.
* `chars` and `bytes` are not attributes anymore, since they are only seldom used, they brought too much of a weight to the string envelope to justify such a spatial overhead
* the `is_dirty` flag was also removed from `FlatBuffer` since it no longer served any purpose
* the `flat_cache_last_pos` attribute is also removed from `Concat` and replaced by a direct access to the length of the underlying cached flat string

The sum of these removals make the envelope of a string lighter, from 104 bytes to 56 bytes.
This proves effective to reduce spatial use and (theoretically) reduces the pressure put on the garbage collector as well as improve caching (64 bytes per line, now a string envelope should fit in completely !).

As an example, passing the JSON parser on a 100 Mio string gives a memory use of:

* Before: 945 Mio
* After: 810 Mio

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

7 years agotests: Added rope substring test with potential corruption if substring is mishandled
Lucas Bajolet [Tue, 28 Jun 2016 20:42:03 +0000 (16:42 -0400)]
tests: Added rope substring test with potential corruption if substring is mishandled

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

7 years agolib/core: Removed some abusive `chars` use in lib
Lucas Bajolet [Wed, 15 Jun 2016 17:43:53 +0000 (13:43 -0400)]
lib/core: Removed some abusive `chars` use in lib

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

7 years agolib: Update mpi to support new buffer API
Lucas Bajolet [Mon, 13 Jun 2016 19:34:38 +0000 (15:34 -0400)]
lib: Update mpi to support new buffer API

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

7 years agolib/core: Made more attributes fun since they are not used frequently
Lucas Bajolet [Mon, 13 Jun 2016 18:02:37 +0000 (14:02 -0400)]
lib/core: Made more attributes fun since they are not used frequently

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

7 years agoMerge: math: Intro `Comparable::clamp`
Jean Privat [Mon, 27 Jun 2016 21:58:42 +0000 (17:58 -0400)]
Merge: math: Intro `Comparable::clamp`

The `clamp` service restricts a value within a given range. It is a common service in GLSL and it is especially useful for games. Even though the alternative is short: `x = x.min(1.0).max(0.0)`, it is quite confusing and the simple `x = x.clamp(0.0, 1.0)` is easier to read.

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

7 years agoMerge: app.nit: intro `Text::open_in_browser` and example for the UI API
Jean Privat [Mon, 27 Jun 2016 21:58:40 +0000 (17:58 -0400)]
Merge: app.nit: intro `Text::open_in_browser` and example for the UI API

This PR intro a service to open a URL using the platform default browser, and an example for the UI API. The example uses most of the available controls, multiple windows and the new `open_in_browser` feature.

The changes to `core::exec` are updates for compatibility with `Text`, and some minor improvements to its doc.

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

7 years agoMerge: gamnit: intro selection services using pixel picking
Jean Privat [Mon, 27 Jun 2016 21:58:29 +0000 (17:58 -0400)]
Merge: gamnit: intro selection services using pixel picking

Intro the selection services for gamnit. It uses a simple color picking algorithm, drawing all the actors to the buffer, each with a unique color used to identify which actor is visible at any pixel.

This algorithm is slow, but it works out of the box with any program. It is recommended for the clients to implement their own optimized alternative adapted to their program for better performances.

The changes to the OpenGL ES wrapper let us use glGet* functions that return a vector of values.
The use of an offset may require more than one call to get the full values, but it's quite simple.

In the future, it should be extended with support for the sprites of the _flat_ API.

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

7 years agoMerge: gamnit & model_viewer: use full model dimensions and show many custom models
Jean Privat [Mon, 27 Jun 2016 21:58:27 +0000 (17:58 -0400)]
Merge: gamnit & model_viewer: use full model dimensions and show many custom models

This PR improves gamnit with new attributes on `Model`: `center, dimensions, min & max`, and a rewrite of the same services on `Mesh`. These are used to better center the model in model_viewer.

model_viewer has also been improved with support for loading many custom models, and fixes to the VR variant.

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

7 years agoMerge: Filter isa adaptation
Jean Privat [Mon, 27 Jun 2016 21:58:24 +0000 (17:58 -0400)]
Merge: Filter isa adaptation

`isa` used to always adapt a local variable, even if there was strict information loss (a warning was shown but the adaptation was effective).

This caused issues for the adaptive typing system since there was no way to retrieve the original type information.

~~~nit
var a: A
a = new B
# a is now a B
if a isa A then
   # warning, but a is now a A
else
  # nothing here, so a is still a B
end
# merge type information of both branches: a isa A or B, thus a isa A
~~~

The change is now that `a isa A` still cause a warning but not more do the adaptation.
Thus in the *then* branch, `a` is still a `B`.
Thus in the merge at the end of the `if`, `a` remains a `B`.

close #2202

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

7 years agoapp.nit: intro example for app::ui
Alexis Laferrière [Thu, 23 Jun 2016 22:05:43 +0000 (18:05 -0400)]
app.nit: intro example for app::ui

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

7 years agoandroid, ios & linux: implement `open_in_browser`
Alexis Laferrière [Thu, 23 Jun 2016 16:13:42 +0000 (12:13 -0400)]
android, ios & linux: implement `open_in_browser`

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

7 years agoapp.nit: intro `Text::open_in_browser`
Alexis Laferrière [Thu, 23 Jun 2016 16:12:58 +0000 (12:12 -0400)]
app.nit: intro `Text::open_in_browser`

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

7 years agoapp.nit: use a ListLayout in http_request example, it looks better on mobile
Alexis Laferrière [Sun, 26 Jun 2016 15:28:51 +0000 (11:28 -0400)]
app.nit: use a ListLayout in http_request example, it looks better on mobile

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

7 years agoapp.nit: add metadata to http_request example for mobile versions
Alexis Laferrière [Thu, 23 Jun 2016 16:03:34 +0000 (12:03 -0400)]
app.nit: add metadata to http_request example for mobile versions

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

7 years agocontrib: update games to use clamp
Alexis Laferrière [Mon, 27 Jun 2016 13:25:44 +0000 (09:25 -0400)]
contrib: update games to use clamp

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

7 years agolib/core/math: intro clamp
Alexis Laferrière [Mon, 27 Jun 2016 02:36:14 +0000 (22:36 -0400)]
lib/core/math: intro clamp

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

7 years agolib/core/exec: improve doc a bin and clean up some commented code
Alexis Laferrière [Fri, 24 Jun 2016 01:09:29 +0000 (21:09 -0400)]
lib/core/exec: improve doc a bin and clean up some commented code

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

7 years agolib/core/exec: accept Text instead of String
Alexis Laferrière [Thu, 23 Jun 2016 16:06:45 +0000 (12:06 -0400)]
lib/core/exec: accept Text instead of String

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

7 years agogamnit: intro selection services, `visible_at` and `visible_in_center`
Alexis Laferrière [Fri, 20 May 2016 18:57:40 +0000 (14:57 -0400)]
gamnit: intro selection services, `visible_at` and `visible_in_center`

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

7 years agogamnit: update users of glGet* functions
Alexis Laferrière [Sun, 26 Jun 2016 13:00:22 +0000 (09:00 -0400)]
gamnit: update users of glGet* functions

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

7 years agoglesv2: intro parameter `offset` to glGet* function wrappers
Alexis Laferrière [Sun, 26 Jun 2016 12:57:34 +0000 (08:57 -0400)]
glesv2: intro parameter `offset` to glGet* function wrappers

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

7 years agomodel_viewer: use a permalink to reach the old cardboard.jar
Alexis Laferrière [Sat, 25 Jun 2016 23:46:11 +0000 (19:46 -0400)]
model_viewer: use a permalink to reach the old cardboard.jar

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

7 years agomodel_viewer: fix path to the android project
Alexis Laferrière [Sat, 25 Jun 2016 23:45:32 +0000 (19:45 -0400)]
model_viewer: fix path to the android project

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

7 years agomodel_viewer: update README with usage info
Alexis Laferrière [Sat, 25 Jun 2016 19:05:01 +0000 (15:05 -0400)]
model_viewer: update README with usage info

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

7 years agomodel_viewer: fit complex models within the viewport
Alexis Laferrière [Sat, 25 Jun 2016 20:52:09 +0000 (16:52 -0400)]
model_viewer: fit complex models within the viewport

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

7 years agomodel_viewer: align models on the Y axis only
Alexis Laferrière [Sat, 25 Jun 2016 18:41:18 +0000 (14:41 -0400)]
model_viewer: align models on the Y axis only

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

7 years agomodel_viewer: when switching to a new model, print its the path
Alexis Laferrière [Sat, 25 Jun 2016 18:39:55 +0000 (14:39 -0400)]
model_viewer: when switching to a new model, print its the path

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

7 years agomodel_viewer: force absolute path for models passed on the command line
Alexis Laferrière [Sat, 25 Jun 2016 20:48:04 +0000 (16:48 -0400)]
model_viewer: force absolute path for models passed on the command line

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

7 years agomodel_viewer: accept more than one extra model on the command line
Alexis Laferrière [Sat, 25 Jun 2016 18:38:32 +0000 (14:38 -0400)]
model_viewer: accept more than one extra model on the command line

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

7 years agogamnit: intro `Model::dimensions & center`
Alexis Laferrière [Sat, 25 Jun 2016 20:50:22 +0000 (16:50 -0400)]
gamnit: intro `Model::dimensions & center`

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

7 years agogamnit: rewrite `Mesh::dimensions & center` and move to its own module
Alexis Laferrière [Sat, 25 Jun 2016 19:03:28 +0000 (15:03 -0400)]
gamnit: rewrite `Mesh::dimensions & center` and move to its own module

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

7 years agogamnit: don't abort when failing to load a texture
Alexis Laferrière [Sat, 25 Jun 2016 18:38:03 +0000 (14:38 -0400)]
gamnit: don't abort when failing to load a texture

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

7 years agotests: update `isa` tests
Jean Privat [Sat, 25 Jun 2016 18:42:32 +0000 (14:42 -0400)]
tests: update `isa` tests

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

7 years agotyping: `isa` do not adapt to a supertype.
Jean Privat [Sat, 25 Jun 2016 16:03:57 +0000 (12:03 -0400)]
typing: `isa` do not adapt to a supertype.

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

7 years agoMerge: Basic Memory Profiler
Jean Privat [Fri, 24 Jun 2016 19:19:04 +0000 (15:19 -0400)]
Merge: Basic Memory Profiler

Here a proof of concept of a basic memory profiler for Nit.
The approach is an option `--trace-memory` that generate a logger with the rest of the code.
Each allocation event produce a line in an time-stamped log file.

When compiling nitc with nitc, the generated log is 300MB. Quite big but manageable.
There is not a lot of optimizations, we let the libc cache the writing of the log.
So there is an overhead.

without `--trace-memory`:
* real 0m5.721s
* user 0m7.216s

with it
* real  0m8.730s (+52%, beause IO I think)
* user 0m9.600s (+33%)

To process the log file, a autonomous tool `memplot` is provided that is made of a nit converter to csv and a R plot script.
There is not a lot of usability, configuration is done by hacking the source code :)

Here a result for the nitc compilation

![memory](https://cloud.githubusercontent.com/assets/135828/16327063/245d273c-399a-11e6-82d3-950db85f7326.png)

The PR is divided into 3 parts:

* preparation of the infrastructure in the compiler (agnostic)
* extension of nitc that refines methods to add the logger
* the quick and dirty memplot tool

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

7 years agoMerge: loader accept qualified names
Jean Privat [Fri, 24 Jun 2016 19:19:01 +0000 (15:19 -0400)]
Merge: loader accept qualified names

Tools understand qualified names `foo::bar` to designate a module in a package.
Basically all this was to allow `-m foo::bar` when compiling.

The specification of the loader is now a little more complex but should be more expressive and POLA.

* `nitc foo.nit` compile the file `./foo.nit`
* `nitc foo` compile a module `foo` that ca be: `./foo/foo.nit` or else `nitlib/foo.nit` or `nitlib/foo/foo.nit`
* `nitc ./foo` or `nitc foo/` or `nitc foo/foo.nit` compile the module `./foo/foo.nit`
* `nitc foo::bar` compile the module `bar` of the package `foo`. foo can be a local directory (`./foo/`) or a sub-directory of the nitpath (`nitlib/foo`). This in fact should work like `import foo::bar` in source code.

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

7 years agoMerge: app.nit: propagate events (such as a button press) to the parents of the control
Jean Privat [Fri, 24 Jun 2016 19:18:47 +0000 (15:18 -0400)]
Merge: app.nit: propagate events (such as a button press) to the parents of the control

UI events, such as a button press or a check box toggle, were only sent to the observers of a control, and the control itself. For this reason, every button was watched by the window or some other container.

Propagating the events to the parents (direct and indirect) reaches the window and all of its containers. This allows for more modular code and components, and it removes the need for manually declaring the window as an observer.

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

7 years agoman: document --trace-memory in nitc.md
Jean Privat [Fri, 24 Jun 2016 13:00:28 +0000 (09:00 -0400)]
man: document --trace-memory in nitc.md

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

7 years agoman: new section DEBUGGING in nitc.md
Jean Privat [Fri, 24 Jun 2016 13:00:01 +0000 (09:00 -0400)]
man: new section DEBUGGING in nitc.md

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

7 years agocontrib/memplot: to visualize output of --trace-memory
Jean Privat [Fri, 24 Jun 2016 12:59:07 +0000 (08:59 -0400)]
contrib/memplot: to visualize output of --trace-memory

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

7 years agotests: add test_loader.args and some detached packages
Jean Privat [Fri, 24 Jun 2016 12:48:56 +0000 (08:48 -0400)]
tests: add test_loader.args and some detached packages

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

7 years agonitc: add memory_logger.nit
Jean Privat [Fri, 24 Jun 2016 02:28:25 +0000 (22:28 -0400)]
nitc: add memory_logger.nit

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

7 years agocompiler: add hooks for before and at the begin of the C `main`
Jean Privat [Fri, 24 Jun 2016 02:09:59 +0000 (22:09 -0400)]
compiler: add hooks for before and at the begin of the C `main`

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

7 years agocompiler: do not call C `nit_alloc` directly but a Nit method.
Jean Privat [Fri, 24 Jun 2016 02:08:36 +0000 (22:08 -0400)]
compiler: do not call C `nit_alloc` directly but a Nit method.

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

7 years agocompiler: remove services for deprecated calloc_array
Jean Privat [Fri, 24 Jun 2016 02:06:05 +0000 (22:06 -0400)]
compiler: remove services for deprecated calloc_array

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

7 years agoengines: remove useless native method `calloc_string`
Jean Privat [Fri, 24 Jun 2016 02:05:06 +0000 (22:05 -0400)]
engines: remove useless native method `calloc_string`

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

7 years agocalculator & benitlux: remove obsolete explicit observer declaration
Alexis Laferrière [Fri, 24 Jun 2016 01:20:21 +0000 (21:20 -0400)]
calculator & benitlux: remove obsolete explicit observer declaration

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

7 years agoapp.nit: events are propagated to parents of controls
Alexis Laferrière [Thu, 23 Jun 2016 22:09:44 +0000 (18:09 -0400)]
app.nit: events are propagated to parents of controls

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

7 years agoapp.nit: fix name of `align` parameter for use in autoinit
Alexis Laferrière [Thu, 23 Jun 2016 22:08:20 +0000 (18:08 -0400)]
app.nit: fix name of `align` parameter for use in autoinit

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

7 years agoMerge: nitlight as a service with embedded editor and ajax updates
Jean Privat [Thu, 23 Jun 2016 20:21:52 +0000 (16:21 -0400)]
Merge: nitlight as a service with embedded editor and ajax updates

It is less and less an example but nitlight_as_a_service now features a client-side editor (http://codemirror.net/) and update the page with some crappy ajax code.

http://test.nitlanguage.org/

Pull-Request: #2197

7 years agoMerge: nitcc: add prefixes
Jean Privat [Thu, 23 Jun 2016 20:21:48 +0000 (16:21 -0400)]
Merge: nitcc: add prefixes

This add the `Prefixes` operator that returns the set of all prefixes of a regular language.
This also fixes some bugs.

Pull-Request: #2195

7 years agoMerge: Nitweb snippets
Jean Privat [Thu, 23 Jun 2016 20:21:37 +0000 (16:21 -0400)]
Merge: Nitweb snippets

Documentation of this PR is [here](http://nitweb.moz-code.org/docdown?snippet=IyBIZWxsbyBHaXRodWIKClRoaXMgaXMgYSBkb2N1bWVudGF0aW9uIHNuaXBwZXQuCllvdSBjYW4gdXNlIGl0IHRvIGRvY3VtZW50IHRoaW5ncyBvbiB0aGUgZmx5IGFuZCBzaGFyZSBpdCB3aXRoIG90aGVyIE5pdCB1c2Vycy4KCiMjIEJhc2ljcwoKQmFzaWNhbGx5LCBEb2Nkb3duIGFsbG93cyB5b3UgdG8gd3JpdGUgbWFyZG93biBkb2N1bWVudGF0aW9uIHVzaW5nIHRoZSBbbWFya2Rvd25dKGh0dHBzOi8vZGFyaW5nZmlyZWJhbGwubmV0L3Byb2plY3RzL21hcmtkb3duLykgZm9ybWF0LgoKU29tZSBleGFtcGxlczoKCn5%2BfnJhdwoqIHRoaXMKKiBpcyBhCiogbGlzdAp%2Bfn4KCj4gVGhpcyBpcyBhIGNpdGF0aW9uLgoKIyMgV3JpdGluZyBuaXQgY29kZQoKRG9jZG93biBkZXBlbmRzIG9uIHRoZSBuaXQgaGlnaGxpZ2h0ZXIgc28geW91IGNhbiB3cml0ZSBOaXQgd2l0aGluIHlvdXIgZG9jIHNuaXBwZXQ6Cgp%2Bfn4KcHJpbnQgImhlbGxvIHdvcmxkIgp%2Bfn4KCiMjIExpbmtpbmcgbW9kZWwgZW50aXRpZXMKCkRvY2Rvd24gdXNlcyBgW1t3aWtpbGlua3NdXWAgdG8gZW5oYW5jZSB0aGUgbWFya2Rvd24gbGFuZ3VhZ2UgZm9yIGRvY3VtZW50YXRpb24uCgpVc2luZyB3aWtpbGlua3MgeW91IGNhbiBjcmVhdGUgbGlua3MgdG8gdGhlIGRvY3VtZW50YXRpb24gb2YgYSBNRW50aXR5IGxpa2UgdGhpczogW1tjb3JlOjpBcnJheV1dCllvdSBjYW4gbGluayB0byBtZW50aXRpZXMgbGlrZSB0aGlzOiBbW2NvcmVdXS4KClRoZSBgZG9jYCBjb21tYW5kIGluamVjdHMgdGhlIGRvY3VtZW50YXRpb24gb2YgYSBNRW50aXR5IGludG8gdGhlIHNuaXBwZXQ6Cgp%2Bfn4KW1tkb2M6IGNvcmU6OkFycmF5XV0Kfn5%2BCgpFeGFtcGxlIHdpdGggdGhlIFtbY29yZTo6QXJyYXldXSBjbGFzczoKW1tkb2M6IGNvcmU6OkFycmF5XV0KCiMjIExpc3RzCgpUaGUgYGxpc3RgIGNvbW1hbmQgaXMgdXNlZCB0byBpbmplY3QgbWVudGl0aWVzIGxpc3RzIGludG8gYSBzbmlwcGV0czoKCiAgICBbW2xpc3Q6IGNvcmU6OmFycmF5XV0KCkV4YW1wbGUgd2l0aCB0aGUgY2xhc3NlcyBpbnRvIHRoZSBbW2NvcmU6OmFycmF5XV0gbW9kdWxlOgpbW2xpc3Q6IGNvcmU6OmFycmF5XV0KCiMjIEluamVjdGluZyBjb2RlCgpVc2UgdGhlIGBjb2RlYCBjb21tYW5kIHRvIGludHJvZHVjZSBhIGNvZGUgc25pcHBldCBpbnRvIHlvdXIgZG9jdW1lbnRhdGlvbjoKCiAgICBbW2NvZGU6IGNvcmU6OkFycmF5Ojpmcm9tXV0KCkV4YW1wbGU6CltbY29kZTogY29yZTo6QXJyYXk6OmZyb21dXQoKIyMgR3JhcGgKCkZpbmFsbHksIHRoZSBgZ3JhcGhgIGNvbW1hbmQgY2FuIGJlIHVzZWQgdG8gaW5zZXJ0IGEgU1ZHIGdyYXBoIGFib3V0IGEgbWVudGl0eS4KCiAgICBbW2dyYXBoOiBjb3JlOjpjb2xsZWN0aW9uXV0KCkV4YW1wbGU6CgpbW2dyYXBoOiBjb3JlOjpjb2xsZWN0aW9uXV0KCiMjIEVycm9ycyBhbmQgd2FybmluZ3MKCk5pdHdlYiB3aWxsIGNoZWNrIHlvdXIgc25pcHBldCBmb3IgaW5jb25zaXN0ZW5jaWVzLgoKSXQgaXMgYWJsZSB0byBsb2NhdGUgdW5rbm93biBjb21tYW5kczoKCn5%2BfnJhdwpbW2xvbDogbG9sXV0Kfn5%2BCgpbW2xvbDogbG9sXV0KClVua25vd24gZW50aXRpZXM6Cgp%2Bfn5yYXcKW1tkb2M6IGxvbF1dCn5%2BfgoKW1tkb2M6IGxvbF1dCgpBbmQgZXZlbiB3YXJuIHlvdSB3aGVuIGluY2x1ZGluZyBlbXB0eSBkb2N1bWVudGF0aW9uOgoKfn5%2BcmF3CltbZG9jOiBjb3JlJENvbXBhcmFibGUkT2JqZWN0OjpTRUxGXV0Kfn5%2BCgpbW2RvYzogY29yZSRDb21wYXJhYmxlJE9iamVjdDo6U0VMRl1d).

PS: Review only the last 3 commits, others are from #2193.

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

7 years agonitcc: tests prefixes
Jean Privat [Thu, 23 Jun 2016 01:33:21 +0000 (21:33 -0400)]
nitcc: tests prefixes

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

7 years agonitcc: fix `Automaton::trim`
Jean Privat [Tue, 21 Jun 2016 17:45:32 +0000 (13:45 -0400)]
nitcc: fix `Automaton::trim`

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

7 years agonitcc: add `Automaton::assert_valid`
Jean Privat [Tue, 21 Jun 2016 17:45:12 +0000 (13:45 -0400)]
nitcc: add `Automaton::assert_valid`

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

7 years agonitcc: add `Prefixes` operator
Jean Privat [Tue, 21 Jun 2016 17:06:36 +0000 (13:06 -0400)]
nitcc: add `Prefixes` operator

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

7 years agonitcc: to_minimal_dfa fix transition checks (and document it)
Jean Privat [Tue, 21 Jun 2016 17:04:45 +0000 (13:04 -0400)]
nitcc: to_minimal_dfa fix transition checks (and document it)

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

7 years agohighlight: avoid some NPE and fix warnings
Jean Privat [Thu, 23 Jun 2016 19:06:27 +0000 (15:06 -0400)]
highlight: avoid some NPE and fix warnings

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

7 years agonitlight_aas: inject a tailing `\n` to avoid parsing issues.
Jean Privat [Thu, 23 Jun 2016 19:08:15 +0000 (15:08 -0400)]
nitlight_aas: inject a tailing `\n` to avoid parsing issues.

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

7 years agonitlight_aas: ajax update the content
Jean Privat [Thu, 23 Jun 2016 18:18:20 +0000 (14:18 -0400)]
nitlight_aas: ajax update the content

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

7 years agonitlight_aas: register and clean line widgets.
Jean Privat [Thu, 23 Jun 2016 18:15:51 +0000 (14:15 -0400)]
nitlight_aas: register and clean line widgets.

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

7 years agonitlight_aas: use linewidgets for error messages
Jean Privat [Thu, 23 Jun 2016 18:10:08 +0000 (14:10 -0400)]
nitlight_aas: use linewidgets for error messages

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

7 years agonitlight_aas: move up hightlightcode
Jean Privat [Thu, 23 Jun 2016 18:07:24 +0000 (14:07 -0400)]
nitlight_aas: move up hightlightcode

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

7 years agonitlight_aas: use codemirror as editor
Jean Privat [Thu, 23 Jun 2016 18:04:18 +0000 (14:04 -0400)]
nitlight_aas: use codemirror as editor

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

7 years agonitlight_aas: HLCode for standalone highlighted piece of code
Jean Privat [Thu, 23 Jun 2016 17:37:14 +0000 (13:37 -0400)]
nitlight_aas: HLCode for standalone highlighted piece of code

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

7 years agonitlight_aas: use templates
Jean Privat [Thu, 23 Jun 2016 17:33:53 +0000 (13:33 -0400)]
nitlight_aas: use templates

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

7 years agonitweb/angular: add DocDown snippets page
Alexandre Terrasa [Wed, 22 Jun 2016 01:20:45 +0000 (21:20 -0400)]
nitweb/angular: add DocDown snippets page

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

7 years agonitweb: add /docdown route
Alexandre Terrasa [Wed, 22 Jun 2016 01:20:10 +0000 (21:20 -0400)]
nitweb: add /docdown route

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

7 years agosrc/doc: add doc command DocGraph
Alexandre Terrasa [Wed, 22 Jun 2016 01:19:51 +0000 (21:19 -0400)]
src/doc: add doc command DocGraph

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

7 years agosrc/doc: remove doc_commands dependency to doc_base
Alexandre Terrasa [Tue, 21 Jun 2016 17:31:57 +0000 (13:31 -0400)]
src/doc: remove doc_commands dependency to doc_base

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

7 years agoMerge: nitweb: misc enhancements and cleaning
Jean Privat [Wed, 22 Jun 2016 17:34:47 +0000 (13:34 -0400)]
Merge: nitweb: misc enhancements and cleaning

## PR summary

* remove useless modules since angular introduction
* factorize some angular code
* factorize routes /package, /group, /module... into /doc
* display error messages
* add a loading progress bar

### Unified routes

Instead of having different prefix on the kind of mentity, URLs are no unified under the `doc/` prefix:

* http://nitweb.moz-code.org/doc/core
* http://nitweb.moz-code.org/doc/core::Array
* http://nitweb.moz-code.org/doc/core::Sequence::append

### Error messages

Unknown mentities now trigger an error message:

* http://nitweb.moz-code.org/doc/core::Sequence::append2

### Loading bar

There is now an orange (but discrete) progress bar in the top of the screen while loading ressources dynamically.

Checkout the top of the screen while loading: http://nitweb.moz-code.org/

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

7 years agonitweb/angular: add loading bar on top of screen
Alexandre Terrasa [Tue, 21 Jun 2016 16:25:25 +0000 (12:25 -0400)]
nitweb/angular: add loading bar on top of screen

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

7 years agonitweb/angular: display an error message when no doc is found for a full_name
Alexandre Terrasa [Tue, 21 Jun 2016 16:24:47 +0000 (12:24 -0400)]
nitweb/angular: display an error message when no doc is found for a full_name

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

7 years agonitweb: api return the unified web_url
Alexandre Terrasa [Tue, 21 Jun 2016 15:51:11 +0000 (11:51 -0400)]
nitweb: api return the unified web_url

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