nit.git
7 years agoshibuqam: we can use `string_arg` directly
Alexis Laferrière [Wed, 12 Oct 2016 15:45:06 +0000 (11:45 -0400)]
shibuqam: we can use `string_arg` directly

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

7 years agonitcorn: fix decoding GET args from percent encoding
Alexis Laferrière [Wed, 12 Oct 2016 15:44:37 +0000 (11:44 -0400)]
nitcorn: fix decoding GET args from percent encoding

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

7 years agoMerge: iOS: complete support for the UI API
Jean Privat [Fri, 7 Oct 2016 19:40:30 +0000 (15:40 -0400)]
Merge: iOS: complete support for the UI API

This PR complete the iOS support of the _app.nit_ UI API and fixes a few bugs:

* Fix `ListLayout` (the scrolling view) so its content fits in the horizontal limits of the screen. (The solution was the "-0-" in the constraint string!)
* Fix detecting when the user taps the system "back" button to correctly resume the previous window.
* Implement `size=` and `align=` on `TextInput` and `Button`. There is some code duplication because the Objective-C properties are not the same.
* Add `TextInput::placeholder=`, the placeholder is often used to identify a text field without using a label on iOS.
* Intro more color related services to extern classes, including a constructor to get the default light gray color used in the background of system menus.
* Bypass the Unicode validity checks so that Unicode characters are left as is, a workaround for #1945. This will cause problems on invalid Unicode strings, but it does work for valid Unicode strings.
* As a bonus, update the resolutions of the icons generated by `inkscape_tools`. Dropping support for older iOS versions and adding support for newer versions.

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

7 years agoMerge: android: click event on button release, better errors and safer `JavaString...
Jean Privat [Fri, 7 Oct 2016 19:40:27 +0000 (15:40 -0400)]
Merge: android: click event on button release, better errors and safer `JavaString::to_s`

Some small tweaks to the Android support:

* `JavaString::to_s` used to crash (at the JNI level) if the associated Java string was null. This was a counterintuitive behavior when the Nit object is non-nullable. This PR prevents this error by returning something similar to the default `Object::to_s` when the underlying Java value is null (for `JavaString` and others). This makes it crash proof, but one should still check if `JavaString::is_java_null` before using the value returned by `to_s` when an actual string is expected.

* Some Java exceptions raised by the Android implementation of `http_get` do not have a message. This PR looks through the causes of such exceptions to find the first available message.

* Also, fix `on_click & ButtonPressEvent` to be raised only when a button is released (instead of at the initial touch).

Pull-Request: #2319
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>

7 years agoinkscape_tools: update the format of icons generated of iOS
Alexis Laferrière [Fri, 23 Sep 2016 15:00:12 +0000 (11:00 -0400)]
inkscape_tools: update the format of icons generated of iOS

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

7 years agoios: don't force spacing between elements of layouts
Alexis Laferrière [Mon, 26 Sep 2016 17:32:52 +0000 (13:32 -0400)]
ios: don't force spacing between elements of layouts

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

7 years agoios: intro services for UIColor, UILabel & UITextField
Alexis Laferrière [Sun, 25 Sep 2016 23:18:52 +0000 (19:18 -0400)]
ios: intro services for UIColor, UILabel & UITextField

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

7 years agoios: workaround for unicode issue #1945
Alexis Laferrière [Sun, 25 Sep 2016 17:28:44 +0000 (13:28 -0400)]
ios: workaround for unicode issue #1945

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

7 years agoios: intro custom view controller and catch back button press
Alexis Laferrière [Fri, 23 Sep 2016 01:10:13 +0000 (21:10 -0400)]
ios: intro custom view controller and catch back button press

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

7 years agoios: fix ListLayout to fit horizontally
Alexis Laferrière [Thu, 22 Sep 2016 16:37:22 +0000 (12:37 -0400)]
ios: fix ListLayout to fit horizontally

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

7 years agoios: redirect prints to NSLog (printf is no longer an output of the simulator)
Alexis Laferrière [Fri, 23 Sep 2016 01:09:38 +0000 (21:09 -0400)]
ios: redirect prints to NSLog (printf is no longer an output of the simulator)

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

7 years agoios: duplicate full implementation of `size= & align=` in TextInput
Alexis Laferrière [Fri, 9 Sep 2016 14:39:42 +0000 (10:39 -0400)]
ios: duplicate full implementation of `size= & align=` in TextInput

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

7 years agoios: Button relay `size= & align=` to its `title_label`
Alexis Laferrière [Fri, 9 Sep 2016 14:39:00 +0000 (10:39 -0400)]
ios: Button relay `size= & align=` to its `title_label`

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

7 years agoios: refactor `Label::size= & align=` services implementation
Alexis Laferrière [Fri, 9 Sep 2016 14:37:55 +0000 (10:37 -0400)]
ios: refactor `Label::size= & align=` services implementation

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

7 years agoMerge: iOS: fix compilation problems, warnings and the Benitlux ios-release rule
Jean Privat [Thu, 29 Sep 2016 19:45:07 +0000 (15:45 -0400)]
Merge: iOS: fix compilation problems, warnings and the Benitlux ios-release rule

General fixes for the iOS support:
* Report errors on `rmdir`, this depends on the fix #2309.
* Fix release mode compilation, the path to the binary was wrong.
* Fix the ios-release rule of Benitlux to use the release mode, contact the right server, and keep the generated files to use from XCode.
* Finally silence the normal output of `xcodebuild`. This looks like a new feature of XCode 8!
* Fixed a few warnings raised by clang.

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

7 years agojava: don't crash on `to_s` when not null in Nit (even if null in Java)
Alexis Laferrière [Tue, 27 Sep 2016 14:49:56 +0000 (10:49 -0400)]
java: don't crash on `to_s` when not null in Nit (even if null in Java)

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

7 years agoandroid: trigger click event on button release
Alexis Laferrière [Wed, 28 Sep 2016 18:42:14 +0000 (14:42 -0400)]
android: trigger click event on button release

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

7 years agoandroid::http_request: fix exception handling
Alexis Laferrière [Tue, 27 Sep 2016 13:01:09 +0000 (09:01 -0400)]
android::http_request: fix exception handling

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

7 years agotests: skip postgres tests on macOS
Alexis Laferrière [Tue, 27 Sep 2016 20:21:52 +0000 (16:21 -0400)]
tests: skip postgres tests on macOS

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

7 years agoMerge: lib/json: unify the writing API using serialization only
Jean Privat [Fri, 23 Sep 2016 19:26:44 +0000 (15:26 -0400)]
Merge: lib/json: unify the writing API using serialization only

Some context first, before this PR, there were 2 API to write JSON:
* The module `static` provided `to_json` and `to_pretty_json` which supported writing only basic Nit types associated with JSON types and objects with a manually implemented `to_json`.
* The module `serialization` provides `serialize_to_json` which supports all `Serializable` types, a superset of the JSON types, and where standard Nit objects are serialized to JSON objects by generated code.

The advantages of the `serialization` API are:
* Objects written to JSON with some metadata (mainly the name of the Nit type) can be deserialized back to Nit objects.
* The boilerplate code to write the attributes is generated, usually a single `is serialize` after the module declarations does the trick. (`core_serialize_to`, the equivalent of `to_json`, doesn't have to be implemented in each classes, the generated version is usually enough.)
* Implementing `core_serialize_to` (or leaving it to the generated code) instead of `to_json` makes the object compatible with both the JSON and binary serialization services.
* In general, the `serialization` API allows to easily write Nit objects to JSON and build JSON objects using `Map` instances:
~~~
import json::serialization

class Person
    serialize

    var name: String
    var year_of_birth: Int
end

var bob = new Person("Bob", 1986)
assert bob.serialize_to_json(pretty=true, plain=true) == """
{
    "name": "Bob",
    "year_of_birth": 1986
}"""

var charlie = new Map[String, nullable Serializable]
charlie["name"] = "Charlie"
charlie["year_of_birth"] = 1968
assert charlie.serialize_to_json(pretty=true, plain=true) == """
{
    "name": "Charlie",
    "year_of_birth": 1968
}"""
~~~

So this PR drops the `static` writing API, and replaces its services (`to_json` and `to_pretty_json`) by aliases in `serialization`. Some subclasses have been updated to implement the recursive `serialize_to` instead of the `to_json`, the changes are minimal to avoid breaking any software, but they are not optimal. The result is a single JSON writing API!

The generated JSON should not have changed much (maybe a bit less or more white spaces), except for some error messages which were translated to invalid JSON and are now serialized to a valid JSON object.

I expect some tests to fail as this is a big change, and clients of the `json::static` writing services (@morriar) should probably double check my changes to their code.

In the future, I'm thinking of dropping the name `serialize_to_json` and `to_pretty_json` and move the optionnal parameters to `to_json`. The JSON module also really needs refactoring at this point.

Pull-Request: #2312
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: nitcorn: possible fix for the bug on input with unicode
Jean Privat [Fri, 23 Sep 2016 03:07:09 +0000 (23:07 -0400)]
Merge: nitcorn: possible fix for the bug on input with unicode

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

7 years agotests: iOS app have one more file
Alexis Laferrière [Thu, 22 Sep 2016 13:06:22 +0000 (09:06 -0400)]
tests: iOS app have one more file

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

7 years agonitcorn: fix input buffer containing unicode
Alexis Laferrière [Wed, 21 Sep 2016 20:08:25 +0000 (16:08 -0400)]
nitcorn: fix input buffer containing unicode

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

7 years agobenitlux: fix ios-release rule and keep the compiled files for XCode GUI
Alexis Laferrière [Fri, 9 Sep 2016 12:39:55 +0000 (08:39 -0400)]
benitlux: fix ios-release rule and keep the compiled files for XCode GUI

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

7 years agolib: fix clang warnings in md5 and pthreads
Alexis Laferrière [Wed, 21 Sep 2016 16:45:34 +0000 (12:45 -0400)]
lib: fix clang warnings in md5 and pthreads

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

7 years agosrc: `exec_and_check` print to stderr
Alexis Laferrière [Fri, 9 Sep 2016 14:35:19 +0000 (10:35 -0400)]
src: `exec_and_check` print to stderr

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

7 years agonitc iOS: quiet output of `xcodebuild`
Alexis Laferrière [Wed, 21 Sep 2016 16:45:54 +0000 (12:45 -0400)]
nitc iOS: quiet output of `xcodebuild`

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

7 years agolib & contrib: update imports
Alexis Laferrière [Wed, 14 Sep 2016 18:43:31 +0000 (14:43 -0400)]
lib & contrib: update imports

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

7 years agolib/json: split the serialization module, replace package entrypoint & update doc
Alexis Laferrière [Thu, 15 Sep 2016 19:34:16 +0000 (15:34 -0400)]
lib/json: split the serialization module, replace package entrypoint & update doc

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

7 years agoMerge: core: fix rmdir not reporting some errors
Jean Privat [Mon, 19 Sep 2016 19:03:36 +0000 (15:03 -0400)]
Merge: core: fix rmdir not reporting some errors

Fix `rmdir` to raise an error on failure to remove a folder, instead of on success. Also fix error management in recursive calls where some errors could be lost.

The name of the attribute `Path::last_error` is misleading with `rmdir` as it stores the first error of the last call, and it is set to `null` if there is no error (overwriting the true last error), so it very rarely contains the actual last error. Note that, `Path::last_error` has a different logic than `Stream::last_error` which does keep the last error and does not reset it. In the future, I would suggest to rename `Path::last_error` to `error` to avoid confusion or to use an array that is cleared at the beginning of each method (as it is currently done with `Path::last_error`).

Pull-Request: #2309
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoneo_doxygen: fix some typos and warnings
Alexis Laferrière [Thu, 15 Sep 2016 14:35:54 +0000 (10:35 -0400)]
neo_doxygen: fix some typos and warnings

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

7 years agoneo_doxygen: remove duplicate tests (copied from docunits)
Alexis Laferrière [Thu, 15 Sep 2016 14:11:49 +0000 (10:11 -0400)]
neo_doxygen: remove duplicate tests (copied from docunits)

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

7 years agoneo4j: update expected test results with full serialized objects
Alexis Laferrière [Thu, 15 Sep 2016 12:53:08 +0000 (08:53 -0400)]
neo4j: update expected test results with full serialized objects

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

7 years agorefund: force last line break and update expected errors
Alexis Laferrière [Thu, 15 Sep 2016 12:52:22 +0000 (08:52 -0400)]
refund: force last line break and update expected errors

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

7 years agotests: update expected results of serialization & json tests
Alexis Laferrière [Thu, 15 Sep 2016 12:55:11 +0000 (08:55 -0400)]
tests: update expected results of serialization & json tests

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

7 years agojson::serialization: inline arrays
Alexis Laferrière [Thu, 15 Sep 2016 12:54:22 +0000 (08:54 -0400)]
json::serialization: inline arrays

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

7 years agojson::serialization: 2 less spaces in non-pretty mode
Alexis Laferrière [Thu, 15 Sep 2016 00:50:55 +0000 (20:50 -0400)]
json::serialization: 2 less spaces in non-pretty mode

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

7 years agorefund & nitrpg: rename 2 conflictual to_json to to_json_object
Alexis Laferrière [Wed, 14 Sep 2016 20:09:07 +0000 (16:09 -0400)]
refund & nitrpg: rename 2 conflictual to_json to to_json_object

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

7 years agotests: update deserialization expected error
Alexis Laferrière [Mon, 12 Sep 2016 14:29:17 +0000 (10:29 -0400)]
tests: update deserialization expected error

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

7 years ago*: update redefs of `to_json`
Alexis Laferrière [Mon, 12 Sep 2016 13:25:38 +0000 (09:25 -0400)]
*: update redefs of `to_json`

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

7 years agojson::serialization: add an example for building a JSON object from a Map
Alexis Laferrière [Wed, 14 Sep 2016 16:53:18 +0000 (12:53 -0400)]
json::serialization: add an example for building a JSON object from a Map

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

7 years agojson::serialization: add compatibility methods to_json and to_pretty_json
Alexis Laferrière [Mon, 12 Sep 2016 20:38:58 +0000 (16:38 -0400)]
json::serialization: add compatibility methods to_json and to_pretty_json

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

7 years agojson::static: all Jsonable are Serializable
Alexis Laferrière [Thu, 11 Aug 2016 13:17:52 +0000 (09:17 -0400)]
json::static: all Jsonable are Serializable

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

7 years agojson::static: reword module doc
Alexis Laferrière [Thu, 11 Aug 2016 13:17:10 +0000 (09:17 -0400)]
json::static: reword module doc

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

7 years agolib/json & nitcc_runtime: make some classes serializable
Alexis Laferrière [Thu, 11 Aug 2016 13:09:41 +0000 (09:09 -0400)]
lib/json & nitcc_runtime: make some classes serializable

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

7 years agolib/json: remove duplicated JSON writing services from static
Alexis Laferrière [Thu, 11 Aug 2016 13:09:24 +0000 (09:09 -0400)]
lib/json: remove duplicated JSON writing services from static

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

7 years agolib/json: bring back string to JSON service to `json::serialization`
Alexis Laferrière [Mon, 25 Apr 2016 14:33:05 +0000 (10:33 -0400)]
lib/json: bring back string to JSON service to `json::serialization`

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

7 years agocore::file: fix error management in recursive calls to `rmdir`
Alexis Laferrière [Fri, 9 Sep 2016 17:07:57 +0000 (13:07 -0400)]
core::file: fix error management in recursive calls to `rmdir`

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

7 years agonitiwiki: update test result to reflect correclty cleaned directories
Alexis Laferrière [Fri, 9 Sep 2016 17:01:39 +0000 (13:01 -0400)]
nitiwiki: update test result to reflect correclty cleaned directories

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

7 years agonitc iOS: fix moving binary in release compilation mode
Alexis Laferrière [Fri, 9 Sep 2016 14:34:37 +0000 (10:34 -0400)]
nitc iOS: fix moving binary in release compilation mode

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

7 years agonitc iOS: report rmdir errors and quit
Alexis Laferrière [Fri, 9 Sep 2016 14:32:42 +0000 (10:32 -0400)]
nitc iOS: report rmdir errors and quit

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

7 years agocore::file: add docunit for expected behavior on deleting existing folders
Alexis Laferrière [Fri, 9 Sep 2016 15:10:01 +0000 (11:10 -0400)]
core::file: add docunit for expected behavior on deleting existing folders

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

7 years agocore::file: fix `rmdir` to raise an error on failure to remove a folder
Alexis Laferrière [Fri, 9 Sep 2016 13:31:32 +0000 (09:31 -0400)]
core::file: fix `rmdir` to raise an error on failure to remove a folder

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

7 years agoMerge: StatementRow::map
Jean Privat [Wed, 7 Sep 2016 01:25:27 +0000 (21:25 -0400)]
Merge: StatementRow::map

I thought this was lacking from the API, so now when dealing with a StatementRow, one can get a map from column name to column value.

NOTE: This is not lazy since Sqlite re-uses the StatementRow for each row returned when a select statement is sent to the database.

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

7 years agotests: Update `test_sqlite3_nity` to include `StatementRow::map`
Lucas Bajolet [Tue, 6 Sep 2016 15:54:25 +0000 (11:54 -0400)]
tests: Update `test_sqlite3_nity` to include `StatementRow::map`

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

7 years agolib/sqlite: Added `map` method to `StatementRow`
Lucas Bajolet [Tue, 6 Sep 2016 15:53:56 +0000 (11:53 -0400)]
lib/sqlite: Added `map` method to `StatementRow`

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

7 years agoMerge: gamnit: fix field of view issues
Jean Privat [Tue, 6 Sep 2016 19:16:12 +0000 (15:16 -0400)]
Merge: gamnit: fix field of view issues

Erroneous code at creation of the perspective matrix caused a wider than requested frustum and field of view. This caused issues in other gamnit code:

* The service `camera_to_world` had to multiply the result by 1.72 to correct the deformation.
* In `asteronits`, the world was not filling the screen, only part of it.
* In general, it created a cool but not desired wide angle lens / fisheye effect.

After the fix, some clients might have to widen the requested visible area, usually set with `reset_height`. We may have to lower the default `field_of_view_y` as it is a bit high.

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

7 years agoaction_nitro: see more world units on screen
Alexis Laferrière [Mon, 5 Sep 2016 17:34:42 +0000 (13:34 -0400)]
action_nitro: see more world units on screen

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

7 years agogamnit: the magic number has been fixed by the fovy
Alexis Laferrière [Mon, 5 Sep 2016 14:13:22 +0000 (10:13 -0400)]
gamnit: the magic number has been fixed by the fovy

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

7 years agogamnit: fix setting camera field of view
Alexis Laferrière [Mon, 5 Sep 2016 14:12:47 +0000 (10:12 -0400)]
gamnit: fix setting camera field of view

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

7 years agoMerge: nitweb: render wikilinks
Jean Privat [Sat, 3 Sep 2016 02:04:14 +0000 (22:04 -0400)]
Merge: nitweb: render wikilinks

This PR allows nitweb to render wikilinks from README.md files.

Here the demo with the lib/core/README.md file: http://nitweb.moz-code.org/doc/core

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

7 years agonitweb: replace default md_processor so nitweb can render README files
Alexandre Terrasa [Thu, 25 Aug 2016 19:46:38 +0000 (15:46 -0400)]
nitweb: replace default md_processor so nitweb can render README files

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

7 years agonitweb: move md_processor to config
Alexandre Terrasa [Thu, 25 Aug 2016 19:45:40 +0000 (15:45 -0400)]
nitweb: move md_processor to config

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

7 years agosrc/doc_down: does not pre escape nit source code
Alexandre Terrasa [Thu, 25 Aug 2016 19:45:05 +0000 (15:45 -0400)]
src/doc_down: does not pre escape nit source code

Fixes a problem of rendering when the nitunit contains `"`

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

7 years agosrc/doc_down: make md processors writable
Alexandre Terrasa [Thu, 25 Aug 2016 19:44:28 +0000 (15:44 -0400)]
src/doc_down: make md processors writable

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

7 years agoMerge: nitweb: use index for quick search
Jean Privat [Thu, 1 Sep 2016 22:41:52 +0000 (18:41 -0400)]
Merge: nitweb: use index for quick search

This PR use the `model_index` API to provide better quicksearch in nitweb.

Demo: http://nitweb.moz-code.org/

Will maybe close a shitstorm of quicksearch related issues but I'm to lazy to check the numbers...

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

7 years agoMerge: nitweb: better namespaces
Jean Privat [Thu, 1 Sep 2016 18:50:21 +0000 (14:50 -0400)]
Merge: nitweb: better namespaces

Before this PR, the namespace composition (adding html things to the MEntity::full_name) was handled by Angular. Namespaces are a pain in the nit to generate, even more when you don't have access to the model... So the solution was to delegate that work to the API.

With this PR, nitweb attach a Namespace object to each MEntity so Angular knows how to render it.
The idea is pretty simple, a namespace is an array of either:

* a string for "::", "$" ...
* an mentity reference like `Array`
* another namespace for recursive definitions

Demo is here: http://nitweb.moz-code.org/

Some examples:

* `core`: http://nitweb.moz-code.org/doc/core
* `core>`: http://nitweb.moz-code.org/doc/core>
* `core::core`: http://nitweb.moz-code.org/doc/core::core
* `core::Array`: http://nitweb.moz-code.org/doc/core::Array
* `core::Array::from`: http://nitweb.moz-code.org/doc/core::Array::from

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

7 years agoMerge: frontend: make the warning on unavailable glslangValidator an advice
Jean Privat [Thu, 1 Sep 2016 01:53:17 +0000 (21:53 -0400)]
Merge: frontend: make the warning on unavailable glslangValidator an advice

Changes the following warning to an advice and raise it at each use of the annotations (instead of only once).

~~~
/nit/lib/gamnit/flat.nit:355,9--26: Warning: program `glslangValidator` not in PATH, cannot validate this shader. (glslvalidator)
""" @ glsl_vertex_shader
~~~

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

7 years agoMerge: app::audio: remove deprecated services and other minor improvements
Jean Privat [Thu, 1 Sep 2016 01:53:16 +0000 (21:53 -0400)]
Merge: app::audio: remove deprecated services and other minor improvements

This PR removes the old `load_sound` and `load_music` services, they were replaced by lazy loading services a while back. The new services are more in line with the other asset loading services from `gamnit`.

There are also other general but minor improvements: doc updates, better names for a param and an attribute, less warnings, less casts, more consistent error messages and easier debugging.

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

7 years agoMerge: typing: Fix minor mistakes in documentation
Jean Privat [Thu, 1 Sep 2016 01:53:15 +0000 (21:53 -0400)]
Merge: typing: Fix minor mistakes in documentation

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

Pull-Request: #2301

7 years agoMerge: json::serialization: don't raise errors on missing attributes with default...
Jean Privat [Thu, 1 Sep 2016 01:53:15 +0000 (21:53 -0400)]
Merge: json::serialization: don't raise errors on missing attributes with default values

This PR fits in the ongoing work to improve deserializing from plain JSON objects.

The JSON deserialization engine no longer raises errors on missing attributes when a default value is available. Attributes may be missing because the JSON object come from a third-party API or
when loading serialized data from a previous version of the software. Default values include simple default values (`var x = 4`), lazy attributes and nullable types (which are set to `null`). This does not yet include `optional` attributes, more work would be needed.

The test/example can be activated when #2296 is fixed.

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

7 years agoMerge: nitweb: light responses
Jean Privat [Thu, 1 Sep 2016 01:53:14 +0000 (21:53 -0400)]
Merge: nitweb: light responses

Nitweb was returning insane amount of data (~2mo of json by request). The new version (http://nitweb.moz-code.org/) is a little more perf.

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

7 years agonitweb/ng: enhance search results display
Alexandre Terrasa [Thu, 25 Aug 2016 19:36:00 +0000 (15:36 -0400)]
nitweb/ng: enhance search results display

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

7 years agonitweb/ng: clean card css
Alexandre Terrasa [Fri, 19 Aug 2016 09:40:12 +0000 (05:40 -0400)]
nitweb/ng: clean card css

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

7 years agonitweb: use model index
Alexandre Terrasa [Thu, 25 Aug 2016 07:14:14 +0000 (03:14 -0400)]
nitweb: use model index

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

7 years agonitweb: move view to config
Alexandre Terrasa [Thu, 25 Aug 2016 07:13:48 +0000 (03:13 -0400)]
nitweb: move view to config

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

7 years agonitweb: autoload focused linearization code
Alexandre Terrasa [Thu, 25 Aug 2016 19:02:42 +0000 (15:02 -0400)]
nitweb: autoload focused linearization code

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

7 years agonitweb: show namespace in frontend
Alexandre Terrasa [Thu, 25 Aug 2016 19:02:28 +0000 (15:02 -0400)]
nitweb: show namespace in frontend

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

7 years agonitweb: add `namespace` key to all mentities json
Alexandre Terrasa [Thu, 25 Aug 2016 19:01:39 +0000 (15:01 -0400)]
nitweb: add `namespace` key to all mentities json

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

7 years agomodel: fix some warnings
Alexandre Terrasa [Thu, 25 Aug 2016 19:01:06 +0000 (15:01 -0400)]
model: fix some warnings

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

7 years agonitweb: fix linearization responses
Alexandre Terrasa [Thu, 25 Aug 2016 05:54:30 +0000 (01:54 -0400)]
nitweb: fix linearization responses

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

7 years agonitweb: use model_json `full_json`
Alexandre Terrasa [Thu, 25 Aug 2016 05:46:05 +0000 (01:46 -0400)]
nitweb: use model_json `full_json`

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

7 years agosrc/model: split model json into short and full json
Alexandre Terrasa [Thu, 25 Aug 2016 05:45:50 +0000 (01:45 -0400)]
src/model: split model json into short and full json

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

7 years agotests: udate JSON tests
Alexis Laferrière [Tue, 30 Aug 2016 14:00:44 +0000 (10:00 -0400)]
tests: udate JSON tests

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

7 years agojson::serialization: document reading from JSON with missing attributes
Alexis Laferrière [Tue, 30 Aug 2016 13:04:05 +0000 (09:04 -0400)]
json::serialization: document reading from JSON with missing attributes

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

7 years agofrontend/serialization: missing nullable attribute are set to null
Alexis Laferrière [Tue, 30 Aug 2016 13:14:19 +0000 (09:14 -0400)]
frontend/serialization: missing nullable attribute are set to null

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

7 years agoserialization: don't throw missing attribute error if there is a default value
Alexis Laferrière [Tue, 30 Aug 2016 02:32:44 +0000 (22:32 -0400)]
serialization: don't throw missing attribute error if there is a default value

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

7 years agofrontend/serialization: leave missing attributes to their default value
Alexis Laferrière [Tue, 30 Aug 2016 13:37:25 +0000 (09:37 -0400)]
frontend/serialization: leave missing attributes to their default value

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

7 years agojson::serialization: engines report when an attributes is missing
Alexis Laferrière [Tue, 30 Aug 2016 02:29:30 +0000 (22:29 -0400)]
json::serialization: engines report when an attributes is missing

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

7 years agofrontend/serialization: remove generated documentation
Alexis Laferrière [Tue, 30 Aug 2016 02:30:12 +0000 (22:30 -0400)]
frontend/serialization: remove generated documentation

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

7 years agomodelize: precise in `has_value` doc the link with `is_lazy`
Alexis Laferrière [Fri, 26 Aug 2016 17:02:47 +0000 (13:02 -0400)]
modelize: precise in `has_value` doc the link with `is_lazy`

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

7 years agotyping: Fix minor mistakes in documentation
Jean-Christophe Beaupré [Mon, 29 Aug 2016 15:33:21 +0000 (11:33 -0400)]
typing: Fix minor mistakes in documentation

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

7 years agoandroid::audio: remove indirection to sounds.add
Alexis Laferrière [Sun, 28 Aug 2016 13:55:46 +0000 (09:55 -0400)]
android::audio: remove indirection to sounds.add

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

7 years agoandroid::audio: revamp param and doc of `load_name`
Alexis Laferrière [Sun, 28 Aug 2016 13:11:46 +0000 (09:11 -0400)]
android::audio: revamp param and doc of `load_name`

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

7 years agoapp::audio: rename `name` to `path`
Alexis Laferrière [Sun, 28 Aug 2016 13:11:04 +0000 (09:11 -0400)]
app::audio: rename `name` to `path`

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

7 years agoapp::audio: update doc
Alexis Laferrière [Sun, 28 Aug 2016 13:05:58 +0000 (09:05 -0400)]
app::audio: update doc

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

7 years agoandroid::audio: print errors at loading sounds
Alexis Laferrière [Sun, 28 Aug 2016 13:02:37 +0000 (09:02 -0400)]
android::audio: print errors at loading sounds

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

7 years agofrontend: always raise advice about missing glslangValidator
Alexis Laferrière [Sun, 28 Aug 2016 15:38:29 +0000 (11:38 -0400)]
frontend: always raise advice about missing glslangValidator

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

7 years agofrontend: make the warning on missing `glslangValidator` an advice
Alexis Laferrière [Sun, 28 Aug 2016 15:12:58 +0000 (11:12 -0400)]
frontend: make the warning on missing `glslangValidator` an advice

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

7 years agoapp::audio: drop the old load_sound and load_music
Alexis Laferrière [Sun, 28 Aug 2016 13:01:17 +0000 (09:01 -0400)]
app::audio: drop the old load_sound and load_music

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