Jean Privat [Wed, 29 Nov 2017 15:40:53 +0000 (10:40 -0500)]
Merge: gamnit: new services and a lot of bug fixes and performance improvements
This PR groups small fixes to gamnit and related packages. It is a general cleanup in preparation for optimizations to the gamnit depth 3D API.
Intro a few new services:
* `ParticleSystem::clear` to remove all live particles.
* `CustomTexture` can be modified and reloaded in GPU memory after the first call to `load`.
* Don't apply dynamic resolution to UI sprites as they are usually lightweight and any change in resolution is easily noticable.
Optimizations:
* Matrix creation and manipulation, in both gamnit and the matrix package.
* Free pixel data from both Nit and Java memory after loading them from the assets folder into the GPU memory.
* Avoids using mallocs in `realtime` services.
Fixes:
* Fix the left and right anchors of the `UICamera`.
* Fix a constant used to ask for antialiasing in the `egl` package.
* Avoid long attribute names in Blinn-Phong shader in case their name is truncated or the attribute is optimized out.
* Fix pointer to the parent GPU texture name in subtextures.
* Improve a few API doc.
Pull-Request: #2586
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Nov 2017 15:40:51 +0000 (10:40 -0500)]
Merge: android: adaptive icons, free memory on demand and use same package in debug mode
This PR extends the new Android compilation toolchain:
* Add support for adaptive icons from Android 8 Oreo (and the older `roundIcon`), see https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive.html. It should detect the icons structure generated by Android Studio 3.
* Tweak the GC compilation options to make it more stable and support releasing memory when the Android system sends the `onLowMemory` message.
* Don't change the app name and package/namespace when compiling in debug mode. While this allowed to easily install both the release and the debug version of the same app on a device, it could be unexpected and it was not compatible with some Google services linked to a precise package name. The old behavior can be reproduced in standard Nit code by using a debug variant like so:
~~~
module asteronits_debug is
app_name "Asteronits debug"
app_namespace "org.nitlanguage.asteronits_debug"
end
import asteronits
~~~
Pull-Request: #2589
Jean Privat [Wed, 29 Nov 2017 15:40:49 +0000 (10:40 -0500)]
Merge: tests: force a utf8 locale because gradle don't like pure ascii
this should fix the CI tests when people with international names make PR.
ref: https://github.com/gradle/gradle/issues/3117
Pull-Request: #2590
Jean Privat [Wed, 29 Nov 2017 13:52:31 +0000 (08:52 -0500)]
tests: update some sav because uft8 locale
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Nov 2017 15:49:10 +0000 (10:49 -0500)]
tests: force a utf8 locale because gradle don't like pure ascii
this should fix the CI tests when people with international names make PR.
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Wed, 1 Nov 2017 15:14:12 +0000 (11:14 -0400)]
android: kindly ask the GC to do its thing when the OS is low on memory
bdwgc will try to release some of its memory if compiled with -DUSE_MUNMAP.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 12 Nov 2017 22:54:02 +0000 (17:54 -0500)]
android: tweak the GC compilation flags
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 10 Nov 2017 15:30:23 +0000 (10:30 -0500)]
android: don't change metadata in debug mode
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 15 Nov 2017 16:08:44 +0000 (11:08 -0500)]
android: accept adaptive icons and other previous icon formats
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Nov 2017 16:47:50 +0000 (11:47 -0500)]
perf analysis: customize float precision in reports
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Nov 2017 15:47:25 +0000 (10:47 -0500)]
realtime: avoid unnecessary mallocs
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Nov 2017 15:46:58 +0000 (10:46 -0500)]
realtime: make native services private
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 21 Nov 2017 19:24:59 +0000 (14:24 -0500)]
gamnit: don't apply dynamic resolution to UI sprites
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 8 Nov 2017 16:58:38 +0000 (11:58 -0500)]
gamnit: dynamic_resolution_ratio should be writable
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Nov 2017 04:27:45 +0000 (23:27 -0500)]
gamnit: free images pixel data from RAM after loading it in GPU memory
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 27 Nov 2017 15:02:56 +0000 (10:02 -0500)]
Merge: nitin FFI seems to work
This adds the bad triple-quoted string and bad extern in the lexer to enable continuing in nitin.
Now FFI seems to work.
~~~raw
-->fun hello `{
...puts("Hello, world");
...`}
-->hello
Hello, world
~~~
Pull-Request: #2587
Jean Privat [Mon, 27 Nov 2017 15:02:55 +0000 (10:02 -0500)]
Merge: android: update compiler to use the "new" toolchain
Update the Android support in the compiler to use of the new official Android toolchain based on gradle and CMake, it replaces the old toolchain based on ndk-build and Android.mk files. The use of the new toolchain makes it easier to connect with libraries, it follow the current examples, it is a bit faster to compile, it automatically downloads the SDK files for the target platforms and it has a decent quiet compilation mode!
The new toolchain brings the following changes to the generate Android projects:
* It adds a new project layer above the app layer, this results in moving most of the generated code down in the `app/src/main` folder.
* It moves some settings (API levels, etc.) out of AndroidManifest.xml to a `build.gradle`.
* It replaces the makefiles Android.mk by CMakeLists.txt.
I took advantage of these changes to bring back the GC support for Nit on Android. The new toolchain executes the standard libgc/bdwgc CMakeLists.txt with only small modifications (based on the Unity fork) and the GC works as expected on Android (with thread support). Having a working GC required tweaking some existing Nit code that did not take into account a functioning GC in order to correctly pin references to Nit objects from Java.
I've also updated the full Docker image to support the new toolchain.
Note that the new Android toolchain supports only 64 bits host platforms with Java 8 JDK.
Future work:
* Support more ABIs, incl. arm64 and x86_64, they should be activated only when targetting their minimum supported platform.
* Compile libunwind with its CMakeLists.txt.
* Support adding extra lines to the gradle files, or accept full gradle files from clients.
Pull-Request: #2575
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 24 Nov 2017 00:16:07 +0000 (19:16 -0500)]
Merge: src/doc: Introduce doc commands
There is 3 doc related tools:
* nitdoc
* nitweb
* nitx
Each tool currently uses an ad-hoc way to explore the model, retrieve and present the results.
This PR aims at unifying the process between all the documentation tools by providing a unique API to explore model and entities.
A `DocCommand` represents a query to perform on the model.
Since a command can be used by a wide variety of clients, initialization of DocCommands works in two steps.
First, you pass the data you already have to the command at init:
~~~nit
# var c1 = new CmdEntity(view, mentity_name = "Array")
# var c2 = new CmdEntity(view, mentity = my_entity)
~~~
Then, you call `init_command` to initialize the missing field from the stub data:
~~~nit
var r1 = c1.init_command
assert c1.mentity != null
assert r1 isa CmdSuccess
var r2 = c2.init_command
assert c2.mentity_name != null
assert r2 isa CmdSuccess
~~~
There is a variety of commands that can be used to fulfill the tool objectives:
* `commands_model`: commands related to model and entities
* `commands_catalog`: commands related to catalog and statistics
* `commands_graph`: commands related to visual representations
* `commands_usage`: commands related to classes and methods usage
* `commands_docdown`: commands related to MDoc parsing and markdown features
To make the integration with tools easier some features are added in:
* `commands_parser`: parse commands from string such as `graph: array | pdepth: 1`
* `commands_http`: initialize commands options from HTTP requests
Rendering options:
* `commands_json`: render the command results as JSON
* `commands_html`: render the command results as HTML
A lot of examples can be found in the test modules.
Pull-Request: #2580
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Nov 2017 20:45:09 +0000 (15:45 -0500)]
nitin: add FFI example in the README
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Nov 2017 20:41:50 +0000 (15:41 -0500)]
nitin: continue on bad triple-quoted string and bad extern
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Nov 2017 20:41:02 +0000 (15:41 -0500)]
lexer: add token for bad extern segment, and bad triple quoted string
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Nov 2017 20:40:12 +0000 (15:40 -0500)]
nitin: display syntax error as soon as possible
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Nov 2017 16:13:00 +0000 (11:13 -0500)]
Merge: app.nit: fix issues in examples and calculator
- Fix missing Makefile dependencies by correctly using the -m options in calls to nitls. It would work without the -m for simple programs but misses some files when there are conditional importations.
- Fix crash in `http_request_example` by updating the latest app.nit UI API from #2547. Closes #2577.
- Compile the scientific desktop variant of the calculator with the `all` rule.
Pull-Request: #2579
Jean Privat [Thu, 23 Nov 2017 16:12:59 +0000 (11:12 -0500)]
Merge: interactive nit: main variables are preserved
This hacks (by refinement) the scope and interpretation services to load and save the states of the local variables of the main method.
`nitin` is now usable for everyday usages:
~~~raw
-->var sum=0
-->for i in [0..5[ do
...print i
...sum += i
...end
0
1
2
3
4
-->print sum
10
~~~
Pull-Request: #2584
Jean Privat [Thu, 23 Nov 2017 16:12:58 +0000 (11:12 -0500)]
Merge: gamnit: distinguish between `create_gamnit` and `create_scene`
Intro `create_gamnit` and `create_scene` to replace the use of `on_create` in gamnit. This change keeps separate the OpenGL setup in `create_gamnit`, from the world/menu creation in `create_scene`. This will allow support for reinitializing the OpenGL context when the EGL context is lost, which may happen on Android when the game goes in the background. It may also support creating a gamnit game separately from the main application.
Current gamnit games should still work despite the API change, but they will need updating to work with the incoming Android support.
Pull-Request: #2585
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Alexandre Terrasa [Tue, 21 Nov 2017 22:31:20 +0000 (17:31 -0500)]
tests: fix model serialization tests
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:39:00 +0000 (23:39 -0400)]
doc/commands: introduce docdown related commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 25 Oct 2017 01:53:24 +0000 (21:53 -0400)]
doc/docdown: render mdoc as markdown
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:43:11 +0000 (23:43 -0400)]
doc/commands: introduce commands group
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:37:44 +0000 (23:37 -0400)]
doc/commands: introduce html rendering for commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 26 Oct 2017 19:01:39 +0000 (15:01 -0400)]
doc/templates: introduce model to html translations
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 25 Oct 2017 02:01:36 +0000 (22:01 -0400)]
lib/html: bootstrap use optional annotation
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 20:16:56 +0000 (16:16 -0400)]
doc/commands: introduce commands results to json translation
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 20:35:36 +0000 (16:35 -0400)]
doc/commands: introduce command initialization from HTTP requests
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:27:16 +0000 (23:27 -0400)]
doc/commands: introduce commands parser
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 21:51:01 +0000 (17:51 -0400)]
doc/commands: introduce catalog commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:15:49 +0000 (23:15 -0400)]
doc/commands: introduce usage commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:15:35 +0000 (23:15 -0400)]
doc/commands: introduce graph commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 03:15:27 +0000 (23:15 -0400)]
doc/commands: introduce model commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 02:37:22 +0000 (22:37 -0400)]
doc/commands: introduce doc commands
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 20:56:47 +0000 (16:56 -0400)]
nitweb: use catalog_json
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 20:56:34 +0000 (16:56 -0400)]
catalog: introduce catalog to json translation
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 20:56:17 +0000 (16:56 -0400)]
catalog: create a group for catalog modules
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 24 Oct 2017 02:24:51 +0000 (22:24 -0400)]
markdown: reset headlines collection between two processing
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Sat, 7 Oct 2017 15:41:21 +0000 (11:41 -0400)]
docker: update for the new Android toolchain and predownload GC and gradle
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 31 Oct 2017 13:31:47 +0000 (09:31 -0400)]
benitlux: fix use of global references from Java FFI
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 27 Sep 2017 14:26:58 +0000 (10:26 -0400)]
android: use global references in `audio` implementation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 7 Apr 2017 15:13:00 +0000 (11:13 -0400)]
android: fix pinning non-local ref to Nit objects from Java
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 24 Oct 2017 21:34:41 +0000 (17:34 -0400)]
android: avoid callbacks in audio implementation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 24 Oct 2017 19:32:52 +0000 (15:32 -0400)]
android: update native_app_glue
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 24 Oct 2017 19:32:37 +0000 (15:32 -0400)]
android: update host setup guide
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 31 Oct 2017 13:31:26 +0000 (09:31 -0400)]
android: activate the GC
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 24 Oct 2017 13:27:39 +0000 (09:27 -0400)]
android: rewrite of the Android support to use the "new" gradle toolchain
This replaces the use of the old ndkbuild toolchain.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 12 Nov 2017 23:12:08 +0000 (18:12 -0500)]
gamnit: don't limit fps by default as most mobile system already limit at 60
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Nov 2017 14:17:09 +0000 (09:17 -0500)]
gamnit: remove duplicated perf stats in shadow
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 8 Nov 2017 16:58:05 +0000 (11:58 -0500)]
gamnit: use shorter names to avoid unpredictable truncation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 26 Oct 2017 17:57:00 +0000 (13:57 -0400)]
gamnit: fix name of parameters visible in free constructor
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 21 Nov 2017 19:34:46 +0000 (14:34 -0500)]
gamnit: allow modification of CustomTextures after loading
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 18 Oct 2017 19:39:18 +0000 (15:39 -0400)]
gamnit: keep source data for CustomTexture to support reloading
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 18 Oct 2017 19:37:39 +0000 (15:37 -0400)]
gamnit: fix subtexture references to the parent's GL name
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Nov 2017 20:52:39 +0000 (15:52 -0500)]
matrix: optimize matrix multiplication
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 17 Oct 2017 00:24:23 +0000 (20:24 -0400)]
matrix: optimize loops
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 17 Oct 2017 00:27:22 +0000 (20:27 -0400)]
matrix: optimize the creation of the `gamnit_rotation_matrix`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 13 Oct 2017 21:29:01 +0000 (17:29 -0400)]
matrix: cache the last `gamnit_euler_rotation` matrix created
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 15 Oct 2017 02:17:40 +0000 (22:17 -0400)]
gamnit: fix camera anchors left and right
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 6 Oct 2017 23:24:45 +0000 (19:24 -0400)]
gamnit: tweak doc of Mesh
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 6 Oct 2017 23:25:51 +0000 (19:25 -0400)]
gamnit: tweak BlinPhongProgram to support drawing many actors at once
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 6 Oct 2017 23:24:30 +0000 (19:24 -0400)]
gamnit: remove unused parameters to `SmoothMaterial::setup_lights`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 6 Oct 2017 23:22:11 +0000 (19:22 -0400)]
gamnit: rename versatile_program to blinn_phong_program
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 6 Oct 2017 14:46:35 +0000 (10:46 -0400)]
gamnit: intro `ParticleSystem::clear`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 10 Oct 2017 15:31:04 +0000 (11:31 -0400)]
glesv2: optimize `GLfloatArray` by a custom implementation and intro `add`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 8 Nov 2017 16:59:16 +0000 (11:59 -0500)]
egl: intro `EGLConfigChooser::samples` and fix a constant
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 27 Sep 2017 12:27:06 +0000 (08:27 -0400)]
asteronits: larger controls
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 30 Sep 2017 17:16:05 +0000 (13:16 -0400)]
gamnit: fix error between comment and code in template project
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 5 Oct 2017 11:27:58 +0000 (07:27 -0400)]
gamnit: move camera default settings to create_scene
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 3 Oct 2017 20:14:35 +0000 (16:14 -0400)]
gamnit: check for more errors
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 26 Sep 2017 19:27:46 +0000 (15:27 -0400)]
gamnit: split use of App::on_create between create_gamnit and create_scene
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 26 Sep 2017 17:36:30 +0000 (13:36 -0400)]
gamnit: reset SpriteSet at create to support recreating the GPU context
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 1 Sep 2017 11:52:50 +0000 (07:52 -0400)]
gamnit: fix sprite set management in flat_core
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 1 Sep 2017 11:52:17 +0000 (07:52 -0400)]
gamnit: fix propagation of on_stop
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 21 Nov 2017 17:12:26 +0000 (12:12 -0500)]
nitin: update README with more examples and main variables
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Nov 2017 16:30:39 +0000 (11:30 -0500)]
nitin: save and inject main variable between prompts
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Nov 2017 16:34:32 +0000 (11:34 -0500)]
naive_interpreter: make `InterpreterFrame::map` and `call_commons` public
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Nov 2017 16:27:45 +0000 (11:27 -0500)]
nitin: get the main_method early to simplify the code
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Nov 2017 16:26:34 +0000 (11:26 -0500)]
nitin: show syntactic errors the standard way
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Nov 2017 16:26:01 +0000 (11:26 -0500)]
nitin: keep the line number increasing between prompts
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Nov 2017 16:17:05 +0000 (11:17 -0500)]
nitin: add optional source name in error messages (for tests)
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Tue, 14 Nov 2017 18:12:52 +0000 (13:12 -0500)]
calculator: add the scientific variant to the `all` Makefile rule
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 9 Nov 2017 13:44:02 +0000 (08:44 -0500)]
app.nit examples: fix dependencies by adding the missing -m to nitls calls
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Nov 2017 18:08:57 +0000 (13:08 -0500)]
app.nit examples: update http_request_example to correctly define the root_window
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Sat, 14 Oct 2017 03:12:35 +0000 (23:12 -0400)]
model_collect: fix collect_ancestors
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 13 Oct 2017 17:48:12 +0000 (13:48 -0400)]
model_views: introduce `mentities_by_name` in views
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 13 Nov 2017 16:03:20 +0000 (11:03 -0500)]
Merge: Model filters: extract filters from ModelVisitor
A list of filters that can be applied on a MEntity
By default ModelFilter accepts all mentity.
~~~nit
var filter = new ModelFilter
assert filter.accept_mentity(my_mentity) == true
~~~
To quickly configure the filters, options can be passed to the constructor:
~~~nit
var filter = new ModelFilter(
min_visibility = protected_visibility,
accept_fictive = false,
accept_test = false,
accept_redef = false,
accept_extern = false,
accept_attribute = false,
accept_empty_doc = false
)
~~~
With this, one can use temporary filters with the model visitors and views:
~~~nit
var default_filter = new ModelFilter(private_visibility)
var view = new ModelView(view, default_filter)
# ...
if view.accept_mentity(mentity) then
# ...
end
# ...
var custom_filter = new ModelFilter(public_visibility)
if view.accept_mentity(mentity, custom_filter) then
# ...
end
~~~
Pull-Request: #2567
Reviewed-by: Jean Privat <jean@pryen.org>
Alexandre Terrasa [Mon, 16 Oct 2017 23:53:43 +0000 (19:53 -0400)]
nitdoc: protect package access when ModelFilters allows fictive modules
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Sun, 22 Oct 2017 21:08:18 +0000 (17:08 -0400)]
tests: fix tests for model visitor
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 16 Oct 2017 23:52:33 +0000 (19:52 -0400)]
tests: fix tests for model filters
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 16 Oct 2017 23:44:13 +0000 (19:44 -0400)]
tests: fix tests for model index
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Sun, 22 Oct 2017 21:11:32 +0000 (17:11 -0400)]
nituml: use model filters
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 19 Oct 2017 00:23:53 +0000 (20:23 -0400)]
nitweb: use model filters
Also introduce new options to control filters
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 17 Aug 2017 20:07:11 +0000 (16:07 -0400)]
nitdoc: use model filters
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>