nit.git
6 years agogamnit: extract general Font from TileSetFont
Alexis Laferrière [Mon, 22 May 2017 17:51:16 +0000 (10:51 -0700)]
gamnit: extract general Font from TileSetFont

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

6 years agodom: intro `XMLTag::attributes_to_map` mapping `XMLStringAttr` to their value
Alexis Laferrière [Sun, 21 May 2017 15:54:56 +0000 (08:54 -0700)]
dom: intro `XMLTag::attributes_to_map` mapping `XMLStringAttr` to their value

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

6 years agodom: return a more precise `Array[XMLTag]` as the doc already said
Alexis Laferrière [Sun, 21 May 2017 15:54:21 +0000 (08:54 -0700)]
dom: return a more precise `Array[XMLTag]` as the doc already said

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

6 years agoMerge: Popcorn: clean tests
Jean Privat [Thu, 18 May 2017 15:02:05 +0000 (11:02 -0400)]
Merge: Popcorn: clean tests

This PR does two things:
* clean the lib by moving all the tests to `tests/` directories, easier to see what is important, great visual improvement for the examples.
* use a lot of imagination to avoid the `class name X already used`. It mostly replaces Short&Cool names by LooooonnggggandAndBooooringNameForSoSimpleHandler. No more warnings when make checking.

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

6 years agoMerge: MultiHashMap: Provide the converse of `add_one`
Jean Privat [Thu, 18 May 2017 15:02:03 +0000 (11:02 -0400)]
Merge: MultiHashMap: Provide the converse of `add_one`

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

Pull-Request: #2446

6 years agoMerge: gamnit: add documentation and standardize the API
Jean Privat [Wed, 17 May 2017 13:53:42 +0000 (09:53 -0400)]
Merge: gamnit: add documentation and standardize the API

Improve the documentation for the central services of gamnit, mainly for entities visible from gamnit.org. Also, to improve the API, remove the `Gamnit` from some class name and move a few named constuctors to factories or their own class.

Pull-Request: #2422
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: rosettacode: Add integer_overflow rosetta code exemple
Jean Privat [Wed, 17 May 2017 13:53:41 +0000 (09:53 -0400)]
Merge: rosettacode: Add integer_overflow rosetta code exemple

Signed-off-by: PatrickBlanchette <PatrickBlanchette@users.noreply.github.com>

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

6 years agoMerge: Popcorn: more validators
Jean Privat [Wed, 17 May 2017 13:53:39 +0000 (09:53 -0400)]
Merge: Popcorn: more validators

Add two more validators:
* URLField that ensures a field contains a valid URL (you want to redefine that regexp).
* UniqField stubs for uniq emails, logins, ids validation.

How to validate uniq field:

~~~nit
class UniqEmailField
super UniqField

var users: UsersRepository

redef fun check_unicity(v, field, val) do
var user = users.find_by_email(val)
if user != null then
v.validation.add_error(field, "Email `{val}` already used")
return false
end
return true
end
end
~~~

Pull-Request: #2435

6 years agoMerge: lib/popcorn: introduce tasks
Jean Privat [Wed, 17 May 2017 13:53:38 +0000 (09:53 -0400)]
Merge: lib/popcorn: introduce tasks

This PR is based on #2436

## Popcorn threaded tasks

 Tasks allow you to execute code in another thread than the app listening loop.
 Useful when you want to run some tasks periodically.

 Let's say you want to purge the `downloads/` directory of your app every hour:

~~~nit
 class PurgeTask
super PopTask

var dir: String

redef fun main do
loop
dir.rmdir
3600.sleep
end
end
 end

 var app = new App

 # Register a new task
 app.register_task(new PurgeTask("downloads/"))

 # Add your handlers
 # app.use('/', new MyHandler)

 # Run the tasks
 app.run_tasks

 # Start the app
 app.listen("0.0.0.0", 3000)
~~~

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

6 years agoMerge: model: Specify `MClassDef`s’ order once
Jean Privat [Wed, 17 May 2017 13:53:37 +0000 (09:53 -0400)]
Merge: model: Specify `MClassDef`s’ order once

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

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

6 years agoMerge: core: fix dynamic error on the input type in `Text::replace`
Jean Privat [Wed, 17 May 2017 13:53:35 +0000 (09:53 -0400)]
Merge: core: fix dynamic error on the input type in `Text::replace`

The previous use of the virtual `SELFTYPE` on a parameter of `replace` was too restrictive and caused a dynamic crash when replacing something in a  `String` by a `FlatBuffer` (for example). This PR uses the more general `Text` as the parameter type, which is already supported by the existing implementation.

The minimal case is not the most useful as doc but I've added it as a unit test anyway:
~~~
var t: Text = "hello"
assert t.replace("hello", new FlatBuffer) == ""
~~~

Pull-Request: #2447

6 years agoMerge: lib/core/stream: fix typo in doc
Jean Privat [Wed, 17 May 2017 13:53:34 +0000 (09:53 -0400)]
Merge: lib/core/stream: fix typo in doc

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

Pull-Request: #2448

6 years agolib/popcorn: fix file inclusion for Jenkins tests
Alexandre Terrasa [Wed, 17 May 2017 13:49:13 +0000 (09:49 -0400)]
lib/popcorn: fix file inclusion for Jenkins tests

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

6 years agolib/popcorn: add `test_path` shortcut in pop_tests
Alexandre Terrasa [Wed, 17 May 2017 13:49:33 +0000 (09:49 -0400)]
lib/popcorn: add `test_path` shortcut in pop_tests

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

6 years agolib/popcorn: lot of class renaming in examples and tests to avoid the `class X alread...
Alexandre Terrasa [Thu, 11 May 2017 23:20:24 +0000 (19:20 -0400)]
lib/popcorn: lot of class renaming in examples and tests to avoid the `class X already defined in...` warning

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

6 years agolib/popcorn: move examples tests to nice and tidy tests/ directories.
Alexandre Terrasa [Thu, 11 May 2017 23:07:37 +0000 (19:07 -0400)]
lib/popcorn: move examples tests to nice and tidy tests/ directories.

So the user/reader directly see the important files.

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

6 years agolib/popcorn: move lib tests to a nice and tidy tests/ directory
Alexandre Terrasa [Mon, 15 May 2017 22:58:51 +0000 (18:58 -0400)]
lib/popcorn: move lib tests to a nice and tidy tests/ directory

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

6 years agolib/popcorn: fix serialization of validation errors
Alexandre Terrasa [Tue, 16 May 2017 20:41:50 +0000 (16:41 -0400)]
lib/popcorn: fix serialization of validation errors

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

6 years agolib/popcorn: introduce UniqueField stub validator
Alexandre Terrasa [Tue, 16 May 2017 20:41:35 +0000 (16:41 -0400)]
lib/popcorn: introduce UniqueField stub validator

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

6 years agolib/popcorn: introduce URLField validator
Alexandre Terrasa [Thu, 11 May 2017 23:08:36 +0000 (19:08 -0400)]
lib/popcorn: introduce URLField validator

Someone is going to be picky on that re...

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

6 years agolib/core/stram: fix typo in doc
Alexandre Terrasa [Tue, 16 May 2017 18:13:46 +0000 (14:13 -0400)]
lib/core/stram: fix typo in doc

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

6 years agogamnit and related: improve doc
Alexis Laferrière [Sun, 7 May 2017 03:41:48 +0000 (23:41 -0400)]
gamnit and related: improve doc

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

6 years agolib/popcorn: introduce popcorn tasks
Alexandre Terrasa [Fri, 12 May 2017 00:44:19 +0000 (20:44 -0400)]
lib/popcorn: introduce popcorn tasks

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

6 years agocore/text: fix input type in `replace`
Alexis Laferrière [Tue, 16 May 2017 15:38:28 +0000 (11:38 -0400)]
core/text: fix input type in `replace`

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

6 years agoMerge: nitcorn: fix HttpRequest::int_arg
Jean Privat [Tue, 16 May 2017 13:28:22 +0000 (09:28 -0400)]
Merge: nitcorn: fix HttpRequest::int_arg

Before this commit, sending `?n=9.5` to a nitcorn application using `int_arg`
caused the app to crash (see the following to_i).

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

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

6 years agoMerge: Custom serializer
Jean Privat [Tue, 16 May 2017 13:28:17 +0000 (09:28 -0400)]
Merge: Custom serializer

This is an old attempt to add the possibility to have a custom serializer. The idea is that a same set of objects can be serialized in different ways if different serializers are used.

Most of what is needed to do that is already present; the main contribution of this PR is the example that tries to propose a way to do that. The example focuses on 3 simples needs:

* inject a phantom attribute.
  when serializing, the custom serializer inject new attributes.
* hide a normally serialized attribute.
  when serializing, the custom serializer hides some specific attributes.
* replace a full business object.
  instead of serializing an attribute, the custom serializer use a different representation

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

6 years agoMerge: lib/core/time: more time related services
Jean Privat [Tue, 16 May 2017 13:28:15 +0000 (09:28 -0400)]
Merge: lib/core/time: more time related services

Three things here:
* Introduce `Int::sleep` because of my hatred for `1.0.sleep`
* Introduce `get_microtime` because timestamp are better in microseconds
* Introduce `get_millitime` because sometimes, god forbid, we have to deal with Javascript

Also, I'm using `sys/time`, pretty sure I'm doing something that should not be in the core library.

Pull-Request: #2436

6 years agoMerge: lib/popcorn: replace json_error method by something more useful
Jean Privat [Tue, 16 May 2017 13:28:13 +0000 (09:28 -0400)]
Merge: lib/popcorn: replace json_error method by something more useful

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

Pull-Request: #2438

6 years agoMerge: lib/json: remove Jsonable and replace it by Serializable
Jean Privat [Tue, 16 May 2017 13:28:10 +0000 (09:28 -0400)]
Merge: lib/json: remove Jsonable and replace it by Serializable

Remove the now useless Jsonable class.

Let's see if something is broken.

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

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

6 years agoMerge: Sha1 is digest
Jean Privat [Tue, 16 May 2017 13:28:07 +0000 (09:28 -0400)]
Merge: Sha1 is digest

Change receiver of Sha1 methods from String to Text since no service was specific to immutable instances, and add a sha1_is_digest method to Text, to check whether an instance matches the signature of a SHA-1 digest or not.

Pull-Request: #2440

6 years agoMerge: separate_compiler: Fix a spelling mistake in a comment
Jean Privat [Tue, 16 May 2017 13:28:00 +0000 (09:28 -0400)]
Merge: separate_compiler: Fix a spelling mistake in a comment

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

Pull-Request: #2443

6 years agoMerge: Makefile: Fix glob patterns
Jean Privat [Tue, 16 May 2017 13:27:58 +0000 (09:27 -0400)]
Merge: Makefile: Fix glob patterns

Forgot the call to `$(wildcard)`.

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

Pull-Request: #2444

6 years agoMultiHashMap: Provide the converse of `add_one`
Jean-Christophe Beaupré [Wed, 10 Aug 2016 15:44:30 +0000 (11:44 -0400)]
MultiHashMap: Provide the converse of `add_one`

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

6 years agoMultiHashMap: Add a test for `add_one`
Jean-Christophe Beaupré [Wed, 10 Aug 2016 15:43:48 +0000 (11:43 -0400)]
MultiHashMap: Add a test for `add_one`

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

6 years agoexamples: rename Int::sleep from FFI examples to Int::sleep_seconds
Alexandre Terrasa [Mon, 15 May 2017 23:16:11 +0000 (19:16 -0400)]
examples: rename Int::sleep from FFI examples to Int::sleep_seconds

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

6 years agomodel: Specify `MClassDef`s’ order once
Jean-Christophe Beaupré [Mon, 15 May 2017 14:57:16 +0000 (10:57 -0400)]
model: Specify `MClassDef`s’ order once

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

6 years agomodel: Register sorters as private attributes of `MModule`
Jean-Christophe Beaupré [Mon, 15 May 2017 14:57:03 +0000 (10:57 -0400)]
model: Register sorters as private attributes of `MModule`

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

6 years agorosettacode: Add integer_overflow rosetta code exemple
PatrickBlanchette [Tue, 9 May 2017 18:04:01 +0000 (14:04 -0400)]
rosettacode: Add integer_overflow rosetta code exemple

Signed-off-by: PatrickBlanchette <PatrickBlanchette@users.noreply.github.com>

6 years agoMakefile: Fix glob patterns
Jean-Christophe Beaupré [Sun, 14 May 2017 22:26:24 +0000 (18:26 -0400)]
Makefile: Fix glob patterns

Forgot the call to `$(wildcard)`.

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

6 years agoseparate_compiler: Fix a spelling mistake in a comment
Jean-Christophe Beaupré [Sun, 14 May 2017 16:46:43 +0000 (12:46 -0400)]
separate_compiler: Fix a spelling mistake in a comment

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

6 years agolib/sha1: add Text::is_sha1_digest
Lucas Bajolet [Sat, 13 May 2017 17:15:20 +0000 (13:15 -0400)]
lib/sha1: add Text::is_sha1_digest

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

6 years agolib/sha1: replace String by Text for sha1 methods
Lucas Bajolet [Sat, 13 May 2017 17:16:21 +0000 (13:16 -0400)]
lib/sha1: replace String by Text for sha1 methods

Since SHA-1 methods might be applied on any kind of Text entity,
we replace the receiver class by Text.

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

6 years agotests: update test for nitserial
Alexandre Terrasa [Fri, 12 May 2017 05:29:32 +0000 (01:29 -0400)]
tests: update test for nitserial

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

6 years agolib/json: remove Jsonable and replace it by Serializable
Alexandre Terrasa [Fri, 12 May 2017 05:29:21 +0000 (01:29 -0400)]
lib/json: remove Jsonable and replace it by Serializable

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

6 years agolib/popcorn: replace json_error method by something more useful
Alexandre Terrasa [Fri, 12 May 2017 01:47:58 +0000 (21:47 -0400)]
lib/popcorn: replace json_error method by something more useful

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

6 years agolib/core/time: also sleep on integers
Alexandre Terrasa [Fri, 12 May 2017 00:08:19 +0000 (20:08 -0400)]
lib/core/time: also sleep on integers

It always bothered me to write `1.0.sleep`...

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

6 years agolib/core/time: introduce get_millitime and get_microtime
Alexandre Terrasa [Fri, 12 May 2017 00:07:33 +0000 (20:07 -0400)]
lib/core/time: introduce get_millitime and get_microtime

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

6 years agonitcorn: fix HttpRequest::int_arg
Alexandre Terrasa [Thu, 11 May 2017 22:24:59 +0000 (18:24 -0400)]
nitcorn: fix HttpRequest::int_arg

Before this commit, sending `?n=9.5` to a nitcorn application using `int_arg`
caused the app to crash (see the following to_i).

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

7 years agoMerge: nitc: add option --run to execute after a successful compilation.
Jean Privat [Wed, 10 May 2017 13:28:41 +0000 (09:28 -0400)]
Merge: nitc: add option --run to execute after a successful compilation.

When the naive interpreter is tooo slooooow but you are too lazy to run the binary yourself.

Pull-Request: #2432

7 years agoMerge: Nitweb: api for code highlighter and nitpicker
Jean Privat [Wed, 10 May 2017 13:20:53 +0000 (09:20 -0400)]
Merge: Nitweb: api for code highlighter and nitpicker

Only the low-level JSON-REST API  is provided. Someone should have to do the rendering.

ping @Morriar

Pull-Request: #2198

7 years agoMerge: gamnit: fix nitunit compatibility
Jean Privat [Wed, 10 May 2017 13:20:50 +0000 (09:20 -0400)]
Merge: gamnit: fix nitunit compatibility

Unit tests in the gamnit module were not executed because Sys::setup exited right away when detecting NIT_TESTING. It affected all gamnit games. This PR check is a platform is bound at the beginning of `Sys::main`, allowing unit tests to run (whether they redef `main` or not).

The check is made possible by the new `bound_platform` which tells what platform is currently bound. This value can be useful in some other cases.

This is an alternative to #2394.

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

7 years agoMerge: core & gamnit: basic support for the characters nbsp, pld and plu
Jean Privat [Wed, 10 May 2017 13:20:49 +0000 (09:20 -0400)]
Merge: core & gamnit: basic support for the characters nbsp, pld and plu

Detect non-breaking spaces in `is_whitespace`, and extend `TextSprites` to accept partial line skips, for sub/superscripts or simple half line skip.

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

7 years agoMerge: gamnit: cache each camera matrix and avoid boxing floats in matrix operations
Jean Privat [Wed, 10 May 2017 13:20:47 +0000 (09:20 -0400)]
Merge: gamnit: cache each camera matrix and avoid boxing floats in matrix operations

Optimize the gamnit framework to avoid excessive garbage collection and a general speedup.

Replace the use of a generic `Array[E]` to implement matrices of floats, as it caused the boxing of each floats at each access. The new custom extern class does not suffer from the boxing and allow for some optimization in C code. This structure is allocated in the Nit GC (hackishly), and doesn't need an explicit liberation. A limitation of the current solution is about the size of the floating points in C, `matrix` uses doubles and `glesv2` floats, the data is copied and cast in C code, this could be optimized further as needed.

Caching each camera matrix avoids recreating them at each frame, which was quite costly, especially for the UI camera that rarely moves. The caching logic is implemented as a distinct class allowing easy debugging.

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

7 years agoMerge: Nitlight: implement first_line and last_line
Jean Privat [Wed, 10 May 2017 13:20:46 +0000 (09:20 -0400)]
Merge: Nitlight: implement first_line and last_line

The existing implementation was silently droped by a previous refactorization.
Reimplement-it and add regression tests

close #2417

Pull-Request: #2429

7 years agotests: update sav//test_highlight_args1.res
Jean Privat [Wed, 10 May 2017 12:51:50 +0000 (08:51 -0400)]
tests: update sav//test_highlight_args1.res

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

7 years agonitc: add option --run to execute after a successful compilation.
Jean Privat [Tue, 9 May 2017 19:27:28 +0000 (15:27 -0400)]
nitc: add option --run to execute after a successful compilation.

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

7 years agomatrix: use a custom low-level C structure to avoid boxing of param types
Alexis Laferrière [Sat, 22 Apr 2017 18:36:04 +0000 (14:36 -0400)]
matrix: use a custom low-level C structure to avoid boxing of param types

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

7 years agoserialization: add an example of a custom serializer
Jean Privat [Mon, 8 May 2017 19:52:38 +0000 (15:52 -0400)]
serialization: add an example of a custom serializer

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

7 years agonitweb: add a low-level `api/light` with highlight
Jean Privat [Thu, 27 Apr 2017 13:02:37 +0000 (09:02 -0400)]
nitweb: add a low-level `api/light` with highlight

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

7 years agopopcorn/pop_handlers: HttpResponse::json_* accepts any Serializable
Jean Privat [Fri, 5 May 2017 19:23:28 +0000 (15:23 -0400)]
popcorn/pop_handlers: HttpResponse::json_* accepts any Serializable

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

7 years agonitlight_aas: offer a low-level JSON service
Jean Privat [Thu, 27 Apr 2017 13:00:24 +0000 (09:00 -0400)]
nitlight_aas: offer a low-level JSON service

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

7 years agotests: add more tests for nitlight
Jean Privat [Tue, 9 May 2017 17:38:03 +0000 (13:38 -0400)]
tests: add more tests for nitlight

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

7 years agonitlight: implements --first-line and --last-line
Jean Privat [Tue, 9 May 2017 17:37:17 +0000 (13:37 -0400)]
nitlight: implements --first-line and --last-line

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

7 years agogamnit: intro cache for `Camera::mvp_matrix`
Alexis Laferrière [Sat, 22 Apr 2017 17:52:40 +0000 (13:52 -0400)]
gamnit: intro cache for `Camera::mvp_matrix`

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

7 years agotests: update error_class_glob
Alexis Laferrière [Tue, 9 May 2017 12:15:34 +0000 (08:15 -0400)]
tests: update error_class_glob

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

7 years agogamnit: support partial line forward and backward
Alexis Laferrière [Mon, 8 May 2017 23:44:56 +0000 (19:44 -0400)]
gamnit: support partial line forward and backward

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

7 years agocore: add non-breaking space to `is_whitespace`
Alexis Laferrière [Mon, 8 May 2017 23:43:30 +0000 (19:43 -0400)]
core: add non-breaking space to `is_whitespace`

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

7 years agoMerge: Update legal stuff
Jean Privat [Mon, 8 May 2017 20:05:35 +0000 (16:05 -0400)]
Merge: Update legal stuff

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

Pull-Request: #2416

7 years agoMerge: git-gen-version: Simplify a `if`
Jean Privat [Mon, 8 May 2017 20:05:34 +0000 (16:05 -0400)]
Merge: git-gen-version: Simplify a `if`

Extracted from PR #2201.

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

Pull-Request: #2418

7 years agoMerge: makefiles: Remove dead code
Jean Privat [Mon, 8 May 2017 20:05:33 +0000 (16:05 -0400)]
Merge: makefiles: Remove dead code

Extracted from PR #2201.

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

Pull-Request: #2419

7 years agoMerge: gamnit: make the template project friendlier for new users
Jean Privat [Mon, 8 May 2017 20:05:32 +0000 (16:05 -0400)]
Merge: gamnit: make the template project friendlier for new users

The `template` project (previously `template_flat`) is a basic project stub that can be built upon to create a gamnit game. This PR should make it a bit easier to copy and rename the project, ensure compatibility with the nit:latest-full Docker, rely on a visible `mkdir` instead of a hidden `.gitignore`, provide a positive first `make` and suggest to implement unit tests.

Pull-Request: #2421

7 years agoMerge: highlight: give more control to clients and fix regressions
Jean Privat [Mon, 8 May 2017 20:05:31 +0000 (16:05 -0400)]
Merge: highlight: give more control to clients and fix regressions

Allow clients to send HTML to `new_dropdown`. Fix two regression bugs introduced by #2231: support for `CallSite` and `MVirtualType`. And as usual, also fix a few local warnings and typos.

This is used by my landing page generator script.

Pull-Request: #2423

7 years agoMerge: Makefile: Don’t invoke `src/Makefile` twice
Jean Privat [Mon, 8 May 2017 20:05:30 +0000 (16:05 -0400)]
Merge: Makefile: Don’t invoke `src/Makefile` twice

Extracted from PR #2201.

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

Pull-Request: #2424

7 years agoserialization: add hooks for a custom serializer
Jean Privat [Mon, 8 May 2017 19:51:21 +0000 (15:51 -0400)]
serialization: add hooks for a custom serializer

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

7 years agoapp.nit: add default behavior to `TextAsset::load` for unit tests
Alexis Laferrière [Mon, 8 May 2017 00:22:19 +0000 (20:22 -0400)]
app.nit: add default behavior to `TextAsset::load` for unit tests

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

7 years agoapp.nit: exit and print an error if not bound to a platform
Alexis Laferrière [Sun, 7 May 2017 22:34:37 +0000 (18:34 -0400)]
app.nit: exit and print an error if not bound to a platform

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

7 years agoMakefile: Don’t invoke `src/Makefile` twice
Jean-Christophe Beaupré [Mon, 8 May 2017 00:18:20 +0000 (20:18 -0400)]
Makefile: Don’t invoke `src/Makefile` twice

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

7 years agoapp.nit: id the platform at runtime
Alexis Laferrière [Mon, 27 Mar 2017 16:28:49 +0000 (12:28 -0400)]
app.nit: id the platform at runtime

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

7 years agogamnit: fix nitunit
Alexis Laferrière [Sat, 6 May 2017 14:15:55 +0000 (10:15 -0400)]
gamnit: fix nitunit

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

7 years agoMakefile: Document `full` more accurately
Jean-Christophe Beaupré [Sun, 7 May 2017 21:32:21 +0000 (17:32 -0400)]
Makefile: Document `full` more accurately

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

7 years agohighlight: new_dropdown accepts raw html
Alexis Laferrière [Sat, 6 May 2017 19:32:22 +0000 (15:32 -0400)]
highlight: new_dropdown accepts raw html

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

7 years agosrc: misc typos, doc and warning fixes
Alexis Laferrière [Sun, 7 May 2017 17:30:53 +0000 (13:30 -0400)]
src: misc typos, doc and warning fixes

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

7 years agohighlight: fix broken support for `MVirtualType`
Alexis Laferrière [Sat, 6 May 2017 19:29:27 +0000 (15:29 -0400)]
highlight: fix broken support for `MVirtualType`

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

7 years agomodel: bring back call site doc to highlight as `CallSite::mdoc_or_fallback`
Alexis Laferrière [Sat, 6 May 2017 19:27:16 +0000 (15:27 -0400)]
model: bring back call site doc to highlight as `CallSite::mdoc_or_fallback`

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

7 years agogamnit: remove `Gamnit` from `GamnitRootTexture` and `GamnitSubtexture`
Alexis Laferrière [Sun, 7 May 2017 03:47:10 +0000 (23:47 -0400)]
gamnit: remove `Gamnit` from `GamnitRootTexture` and `GamnitSubtexture`

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

7 years agogamnit: move `Model::uv_sphere` to `UVSphere`
Alexis Laferrière [Sun, 7 May 2017 03:45:24 +0000 (23:45 -0400)]
gamnit: move `Model::uv_sphere` to `UVSphere`

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

7 years agogamnit: move `new SmoothMaterial::default` to `new Material`
Alexis Laferrière [Sun, 7 May 2017 03:44:36 +0000 (23:44 -0400)]
gamnit: move `new SmoothMaterial::default` to `new Material`

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

7 years agogamnit: shorten template_flat to template and update namespace
Alexis Laferrière [Sun, 7 May 2017 16:23:03 +0000 (12:23 -0400)]
gamnit: shorten template_flat to template and update namespace

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

7 years agogamnit: add the check rule to the template makefile and remove all
Alexis Laferrière [Sat, 6 May 2017 13:49:19 +0000 (09:49 -0400)]
gamnit: add the check rule to the template makefile and remove all

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

7 years agogamnit & contrib: lower the Android target API
Alexis Laferrière [Sat, 6 May 2017 13:44:56 +0000 (09:44 -0400)]
gamnit & contrib: lower the Android target API

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

7 years agotinks/Makefile: Remove an undefined phony target
Jean-Christophe Beaupré [Mon, 22 Aug 2016 15:46:22 +0000 (11:46 -0400)]
tinks/Makefile: Remove an undefined phony target

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

7 years agotests/Makefile: Remove unused macro
Jean-Christophe Beaupré [Wed, 22 Jun 2016 21:12:49 +0000 (17:12 -0400)]
tests/Makefile: Remove unused macro

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

7 years agoMakefile: Remove unused macro
Jean-Christophe Beaupré [Wed, 22 Jun 2016 21:12:11 +0000 (17:12 -0400)]
Makefile: Remove unused macro

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

7 years agogit-gen-version: Simplify a `if`
Jean-Christophe Beaupré [Wed, 22 Jun 2016 21:10:59 +0000 (17:10 -0400)]
git-gen-version: Simplify a `if`

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

7 years agogamnit: template use `mkdir bin` instead of a .gitignore for visibility
Alexis Laferrière [Sat, 6 May 2017 13:36:15 +0000 (09:36 -0400)]
gamnit: template use `mkdir bin` instead of a .gitignore for visibility

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

7 years agoNOTICE: Update
Jean-Christophe Beaupré [Wed, 3 May 2017 15:30:51 +0000 (11:30 -0400)]
NOTICE: Update

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

7 years agolicense: add GNU GPLv3
Jean-Christophe Beaupré [Wed, 3 May 2017 15:30:26 +0000 (11:30 -0400)]
license: add GNU GPLv3

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

7 years agoMerge: gamnit: fix gamepad path, pixelated minification, text X align and low-opacity...
Jean Privat [Mon, 1 May 2017 15:49:51 +0000 (11:49 -0400)]
Merge: gamnit: fix gamepad path, pixelated minification, text X align and low-opacity textures

A few fixes to gamnit:

* Fix path of virtual gamepad texture.
* Fix the look of `pixelated` textures when minified (zoomed out).
* Fix X align of `TextSprites` so the first letter starts from the given coordinate.
* Lower the threshold to discard transparent fragments.

Pull-Request: #2415

7 years agoMerge: opportunity: official docker image
Jean Privat [Mon, 1 May 2017 15:49:04 +0000 (11:49 -0400)]
Merge: opportunity: official docker image

Now that nitcorn can listen on any interface, why not having lightweight standalone web applications?

How to build?
1. install docker
2. cd nit/contrib/opportunity/docker
3. docker build --tag opportunity .

How to run?
1. docker run -d -p 8080:8080 --name  opportunity opportunity
2. xdg-open http://localhost:8080
3. docker stop opportunity

or just get it from the [hub](https://hub.docker.com/r/nitlang/opportunity/tags/)
1. docker run -d -p 8080:8080 --name opportunity nitlang/opportunity

Pull-Request: #2284
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>

7 years agogamnit: fix virtual gamepad asset name
Alexis Laferrière [Thu, 13 Apr 2017 17:37:33 +0000 (13:37 -0400)]
gamnit: fix virtual gamepad asset name

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