Alexis Laferrière [Thu, 4 Aug 2016 16:33:55 +0000 (12:33 -0400)]
json::serialization: report duplicated keys
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 14:40:05 +0000 (10:40 -0400)]
tests: report deserialization errors
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 14:39:52 +0000 (10:39 -0400)]
tests: fix deserialization test on pretty json with generics
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 13:44:04 +0000 (09:44 -0400)]
nitserial: silence property-conflict warning in generated module
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 13:43:29 +0000 (09:43 -0400)]
lib/gen_nit: support writing annotations of the module declaration
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 14:21:08 +0000 (10:21 -0400)]
json::serialization: check format and consistency of Map at deserialization
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 14:20:42 +0000 (10:20 -0400)]
json::serialization: don't crash on deserializing malformed simple collections
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 13:41:03 +0000 (09:41 -0400)]
json::serialization: fix indentation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 13:38:49 +0000 (09:38 -0400)]
json::serialization: fix serializing extra attributes of collections and maps
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 13:37:53 +0000 (09:37 -0400)]
json::serialization: refactor some duplicated code
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 14:53:37 +0000 (10:53 -0400)]
frontend: use a prettier "Unknown type" when the type is not in the AST
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 14:22:34 +0000 (10:22 -0400)]
serialization: AttributeTypeError doesn't need the message attribute, fix TODO
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 4 Aug 2016 13:45:11 +0000 (09:45 -0400)]
frontend: don't type check values for attributes typed with `nullable Object`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 3 Aug 2016 16:38:46 +0000 (12:38 -0400)]
Merge: app.nit: improve apps life-cycle
Modify the _app.nit_ life-cycle callbacks to add `on_restart`, and to remove `on_start` and `on_destroy`. `on_restart` is called when the app goes comes back from a `on_stop`. `on_start` duplicated other callbacks (`on_create` and the new `on_restart`), plus it didn't have a direct equivalent in iOS. `on_destroy` also didn't have an iOS equivalent. These changes simplify the life-cycle and use only callbacks existing on both platforms.
This PR also improves the documentation of the _app.nit_ life-cycle with a nice little graph and references to the platform specific triggers.
Pull-Request: #2229
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
Jean Privat [Wed, 3 Aug 2016 16:38:43 +0000 (12:38 -0400)]
Merge: app.nit: Intro the `app_files` annotation, and use it in calculator
Intro `app_files`, an annotation to specify where to find more Android and iOS specific files. This effectively associates resources to a specific Nit module. It can be used to have different icons per branding, or to package graphical assets with a module from the lib.
It is used in the calculator to assign a different icon to the scientific calculator variant.
Pull-Request: #2228
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Jean Privat [Wed, 3 Aug 2016 16:38:33 +0000 (12:38 -0400)]
Merge: Android: import the R class
The R class is generated by the Android toolchain and acts as a static way to identify resources in Java code. The ID of each values from the `android/res` folder is sorted in a category and accessible through a static field. An example of a generated R class is shown at the bottom of this description.
This PR import the R class in all Java classes generated from the Java FFI. This creates a similar effect as having the R class in the same package. Previously, the user could not reliably import the R class manually as the package name changes between the debug and release version.
~~~
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package net.xymus.benitlux_debug;
public final class R {
public static final class attr {
}
public static final class color {
public static final int item_background=0x7f050000;
}
public static final class drawable {
public static final int ic_launcher=0x7f020000;
public static final int icon=0x7f020001;
public static final int notif=0x7f020002;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
}
}
~~~
Pull-Request: #2227
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 3 Aug 2016 16:38:26 +0000 (12:38 -0400)]
Merge: nitweb: show metrics
This PR introduce the metrics displaying in nitweb.
For now, only classes and modules metrics are shown (mclass_metrics.nit, mmodules_metrics.nit, inheritance_metrics.nit).
Some examples (may be long to load on my little server):
* [core::Array](http://nitweb.moz-code.org/doc/core::Array)
* [core::array](http://nitweb.moz-code.org/doc/core::array)
* [core>collection>](http://nitweb.moz-code.org/doc/core%3Ecollection%3E)
* [core](http://nitweb.moz-code.org/doc/core)
Pull-Request: #2219
Reviewed-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Fri, 29 Jul 2016 18:38:38 +0000 (14:38 -0400)]
linux: update lifecycle
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 Jul 2016 15:49:24 +0000 (11:49 -0400)]
app.nit: document platform specific triggers for each app.nit callbacks
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 Jul 2016 13:18:36 +0000 (09:18 -0400)]
app.nit: update README and add graph image
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 28 Jul 2016 20:14:04 +0000 (16:14 -0400)]
lib & contrib: remove references to on_start and on_destroy
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 Jul 2016 12:59:29 +0000 (08:59 -0400)]
android: call on_restart
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 28 Jul 2016 20:14:39 +0000 (16:14 -0400)]
lib/ios: update lifecycle
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 Jul 2016 12:55:00 +0000 (08:55 -0400)]
app.nit: intro `on_restart`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 28 Jul 2016 20:13:23 +0000 (16:13 -0400)]
app.nit & android: move on_create & on_destroy to Android only
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 17:12:07 +0000 (13:12 -0400)]
benitlux: fix typo in `ItemView::set_background`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 13:37:27 +0000 (09:37 -0400)]
calculator: separate Android variants between the simple calc and the sci one
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 13:29:28 +0000 (09:29 -0400)]
calculator: have a different icon and app name for the scientific variant
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 13:36:11 +0000 (09:36 -0400)]
calculator: shorter name and bump up the version number
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 13:08:50 +0000 (09:08 -0400)]
calculator: name icon rules to real files
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 13:07:42 +0000 (09:07 -0400)]
calculator: move `scientific_calculator` to its own folder `scientific`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 03:22:20 +0000 (23:22 -0400)]
iOS: use `app_files`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 03:09:47 +0000 (23:09 -0400)]
Android: use `app_files` to find android specific files
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 01:51:59 +0000 (21:51 -0400)]
Android: move up assets and resources logic
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 01:53:29 +0000 (21:53 -0400)]
Android & iOS: collect the arguments from the `app_files` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 22 Jul 2016 01:52:47 +0000 (21:52 -0400)]
lib: intro and doc the `app_files` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 21 Jul 2016 22:52:54 +0000 (18:52 -0400)]
benitlux: use the R class
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 21 Jul 2016 22:42:49 +0000 (18:42 -0400)]
Android support: import the R class at the top of all java files from the FFI
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 21 Jul 2016 22:51:55 +0000 (18:51 -0400)]
Java FFI: make `MModule::java_file` public
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Mon, 4 Jul 2016 23:32:12 +0000 (19:32 -0400)]
nitweb/angular: add metrics tab for packages, groups, modules and classes
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:31:50 +0000 (19:31 -0400)]
nitweb/angular: add metrics directives
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:31:27 +0000 (19:31 -0400)]
nitweb/angular: import d3pie js lib
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:27:11 +0000 (19:27 -0400)]
nitweb/angular: model load metrics
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:26:29 +0000 (19:26 -0400)]
nitweb: introduce metrics API
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:23:01 +0000 (19:23 -0400)]
model_collect: collect accessible methods and VTs
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 20 Jul 2016 16:04:26 +0000 (12:04 -0400)]
tests: update nitmetrics output
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:22:45 +0000 (19:22 -0400)]
metrics: add metric about abstract class inheritance
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:22:09 +0000 (19:22 -0400)]
metrics: add Number of Accessible Definition metric for mmodule
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 23:21:34 +0000 (19:21 -0400)]
metrics: add metrics about class content kind
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 22:01:26 +0000 (18:01 -0400)]
metrics: factorize `mainmodule` and `model_view` for all MModule metrics
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 4 Jul 2016 22:00:39 +0000 (18:00 -0400)]
metrics: factorize `mainmodule` and `model_view` attributes for all MClass metrics
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 11 Jul 2016 17:02:48 +0000 (13:02 -0400)]
Merge: Improve (and fix) Docker
#2181 broke the initial bootstrap because nitc was not found to build nitmd thus failed the `make man`
This PR also cleanup the dockerfiles so the root/ directory is not more used (this cause issue for non-root users)
Pull-Request: #2226
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 11 Jul 2016 14:21:31 +0000 (10:21 -0400)]
docker: do not install in /root as it is not accessible to unprivileged user
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 11 Jul 2016 14:19:52 +0000 (10:19 -0400)]
fix nitc path when making manpages
This broke Docker
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 11 Jul 2016 13:48:50 +0000 (09:48 -0400)]
Merge: global_compiler: Write errors to stderr
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2225
Jean Privat [Mon, 11 Jul 2016 13:48:48 +0000 (09:48 -0400)]
Merge: separate_compiler: Write errors to stderr
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2224
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 11 Jul 2016 13:48:43 +0000 (09:48 -0400)]
Merge: gamnit: add tileset and bitmap font support
This PR intro `TileSet, TileSetFont and TextSprites` to gamnit, allowing to draw text from bitmap fonts via sprites. The new module reuse some code from `mnit::tileset` and Action Nitro.
Pull-Request: #2222
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Mon, 11 Jul 2016 13:48:41 +0000 (09:48 -0400)]
Merge: NOTICE: Fix years
There is at least one commit from @calestar in 2008.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2221
Jean-Christophe Beaupré [Fri, 8 Jul 2016 22:02:37 +0000 (18:02 -0400)]
global_compiler: Write errors to stderr
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 8 Jul 2016 22:02:15 +0000 (18:02 -0400)]
separate_compiler: Write errors to stderr
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Alexis Laferrière [Mon, 4 Jan 2016 00:42:41 +0000 (19:42 -0500)]
lib/gamnit: intro tileset (partial copy of mnit::tileset)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>