nit.git
8 years agoexamples/mnit_ballz: fix call on nullable receiver warnings
Alexandre Terrasa [Wed, 20 Apr 2016 06:37:33 +0000 (02:37 -0400)]
examples/mnit_ballz: fix call on nullable receiver warnings

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

8 years agocontrib: fix call on nullable receiver warnings
Alexandre Terrasa [Wed, 20 Apr 2016 06:37:09 +0000 (02:37 -0400)]
contrib: fix call on nullable receiver warnings

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

8 years agocontrib: fix useless signature in redef warning
Alexandre Terrasa [Wed, 20 Apr 2016 06:36:31 +0000 (02:36 -0400)]
contrib: fix useless signature in redef warning

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

8 years agocontrib/inkscape_tools: fix weird parenthesis
Alexandre Terrasa [Wed, 20 Apr 2016 22:40:33 +0000 (18:40 -0400)]
contrib/inkscape_tools: fix weird parenthesis

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

8 years agocontrib/inkscape_tools: fix noinit in redef warning
Alexandre Terrasa [Wed, 20 Apr 2016 06:35:06 +0000 (02:35 -0400)]
contrib/inkscape_tools: fix noinit in redef warning

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

8 years agoMerge: Split catalog into a lib and a program
Jean Privat [Mon, 18 Apr 2016 12:51:54 +0000 (08:51 -0400)]
Merge: Split catalog into a lib and a program

As requested by @Morriar, the nitcatalog tool is now splited into a lib and a program.

Pull-Request: #2017
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: iOS: support apps with multiple windows, and a better ListLayout
Jean Privat [Mon, 18 Apr 2016 12:51:53 +0000 (08:51 -0400)]
Merge: iOS: support apps with multiple windows, and a better ListLayout

Support multiple windows on iOS by using a UINavigationController as the root controller which shows the navigation bar at the top of the screen. The navigation bar shows the "Back" button automatically when switching windows. It has room for a title, which can be set manually. This is not ideal as pure portable apps don't define a title leaving the bar mostly empty. This could be fixed either by always asking for a title or by using the app names a default title.

Rewrite the implementation of the ListLayout using a UIStackView in a UIScrollView. This implementation is easier to adapt to different content, and it much more simple than the previous one which used a UITableView. The table view implementation has been kept as a different iOS specific control, but it may be removed in the future.

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

8 years agoMerge: app.nit services to set the size and alignment of labels
Jean Privat [Mon, 18 Apr 2016 12:51:51 +0000 (08:51 -0400)]
Merge: app.nit services to set the size and alignment of labels

Intro services to customize the size and alignment of text views. Only labels are supported on all platforms but Android also supports customizing text buttons. The behaviour on each platform varies a bit according to the available features. The goal is always to have the behaviour that is more natural on the platform instead of having the same exact look on each platform. Sticking to the recommended values should produce more consistent results, but using other values can create interesting effects.

For example, on Android and Linux, the text size is locked to a small/medium/large, but on iOS the size can be set to any variations relative to the default font size. On all platforms, 0.5 should result in a small font, 1.0 the default/medium size and 1.5 the large size. On iOS, other values will result in different text sizes.

I've used the same logic as `Text::justify` to set the alignment with a single float parameter.

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

8 years agonitcatalog: add a new class Person
Jean Privat [Mon, 18 Apr 2016 00:53:14 +0000 (20:53 -0400)]
nitcatalog: add a new class Person

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

8 years agonitc: split nitcatalog into a lib and a program
Jean Privat [Sun, 17 Apr 2016 01:49:14 +0000 (21:49 -0400)]
nitc: split nitcatalog into a lib and a program

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

8 years agolib/ios: implement `Label::size= & align=`
Alexis Laferrière [Sat, 2 Apr 2016 21:54:44 +0000 (17:54 -0400)]
lib/ios: implement `Label::size= & align=`

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

8 years agolib/ios: support multiple windows using a UINavigationController
Alexis Laferrière [Mon, 14 Mar 2016 20:53:06 +0000 (16:53 -0400)]
lib/ios: support multiple windows using a UINavigationController

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

8 years agolib/ios: ListLayout use a UIStackView inside a UIScrollView
Alexis Laferrière [Fri, 15 Apr 2016 15:23:57 +0000 (11:23 -0400)]
lib/ios: ListLayout use a UIStackView inside a UIScrollView

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

8 years agolib/ios: use simple init constructor in Objective-C when possible
Alexis Laferrière [Thu, 14 Apr 2016 18:44:33 +0000 (14:44 -0400)]
lib/ios: use simple init constructor in Objective-C when possible

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

8 years agolib/ios: do not crash when removing a non-View control
Alexis Laferrière [Fri, 8 Apr 2016 18:57:51 +0000 (14:57 -0400)]
lib/ios: do not crash when removing a non-View control

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

8 years agonitc iOS: use ???? as bundle signature (now we can)
Alexis Laferrière [Mon, 14 Mar 2016 20:52:58 +0000 (16:52 -0400)]
nitc iOS: use ???? as bundle signature (now we can)

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

8 years agolib/linux: implement `Label::size= & align=`
Alexis Laferrière [Sat, 2 Apr 2016 17:27:08 +0000 (13:27 -0400)]
lib/linux: implement `Label::size= & align=`

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

8 years agolib/android: implement `TextView::size= & align=` and replace `text_size`
Alexis Laferrière [Sat, 2 Apr 2016 22:06:38 +0000 (18:06 -0400)]
lib/android: implement `TextView::size= & align=` and replace `text_size`

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

8 years agolib/app: intro `TextView::size= & align=`
Alexis Laferrière [Wed, 25 Nov 2015 21:29:58 +0000 (16:29 -0500)]
lib/app: intro `TextView::size= & align=`

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

8 years agolib/gtk: intro `GtkLabel::justify` and the `set_markup` service
Alexis Laferrière [Fri, 15 Apr 2016 14:26:40 +0000 (10:26 -0400)]
lib/gtk: intro `GtkLabel::justify` and the `set_markup`  service

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

8 years agolib/gtk: fix uncallable / unimplemented alignment and padding services
Alexis Laferrière [Sat, 2 Apr 2016 17:26:43 +0000 (13:26 -0400)]
lib/gtk: fix uncallable / unimplemented alignment and padding services

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

8 years agoMerge: Introducing the do ... catch ... end structure
Jean Privat [Thu, 14 Apr 2016 01:03:06 +0000 (21:03 -0400)]
Merge: Introducing the do ... catch ... end structure

This PR is a first step in trying to handle exceptions in Nit, replacing the behaviour of `abort` if it happens within a do ... catch ... end.

In the compiler, setjmp() et longjmp() are used to jump directly from the `abort` to the nearest `catch` bloc.

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

8 years agoMerge: Benitlux & sqlite3: fix closing SQLite statements and malformed superstring
Jean Privat [Thu, 14 Apr 2016 01:03:03 +0000 (21:03 -0400)]
Merge: Benitlux & sqlite3: fix closing SQLite statements and malformed superstring

Fix statements that were left open and did not remove the lock on the database. It now relies on iterators to close the statement after the end of the loop. This requires to actually complete the loop and not return before it is complete. A shortcut is to use `statement.iterator.to_a` when the result is expected to be short, like with a single row.

Note that I did not use `with` because it has the same problem with a `return` skipping the call to `finish`. Neither did I use `Finalizable` because it is invoked by the GC which may be much later.

Also fix one malformed superstring and improve the style of another one.

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

8 years agotests: introducing some tests for the catch
BlackMinou [Sat, 9 Apr 2016 01:24:10 +0000 (21:24 -0400)]
tests: introducing some tests for the catch

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoCompiler: using longjumps for the catch blocs
BlackMinou [Sat, 9 Apr 2016 00:23:09 +0000 (20:23 -0400)]
Compiler: using longjumps for the catch blocs

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoInterpreter: using catch to modify abort behaviour
BlackMinou [Sat, 9 Apr 2016 00:22:21 +0000 (20:22 -0400)]
Interpreter: using catch to modify abort behaviour

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoScope & Typing: visits the catch part of a do ... catch ... end
BlackMinou [Sat, 9 Apr 2016 00:20:43 +0000 (20:20 -0400)]
Scope & Typing: visits the catch part of a do ... catch ... end

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoFlow: managing the flow context for a do ... catch ... end
BlackMinou [Sat, 9 Apr 2016 00:19:43 +0000 (20:19 -0400)]
Flow: managing the flow context for a do ... catch ... end

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoParser: Modifications due to the introduction of catch
BlackMinou [Sat, 9 Apr 2016 00:18:27 +0000 (20:18 -0400)]
Parser: Modifications due to the introduction of catch

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoGrammar: Adding an optionnal catch bloc to a do end
BlackMinou [Sat, 9 Apr 2016 00:17:47 +0000 (20:17 -0400)]
Grammar: Adding an optionnal catch bloc to a do end

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agolib/sqlite3: improve doc and customization of the iterator closing statements
Alexis Laferrière [Mon, 11 Apr 2016 16:10:25 +0000 (12:10 -0400)]
lib/sqlite3: improve doc and customization of the iterator closing statements

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

8 years agoMerge: Unify escaping
Jean Privat [Sat, 9 Apr 2016 13:58:02 +0000 (09:58 -0400)]
Merge: Unify escaping

For some historical reasons, the `return` was managed slightly differently from `break` and `continue`.

This PR unify the whole thing thus simplify how the escaping mechanism is handled by the interpreted. By the way this also fixes #2008 (that is caused by an unhandled `return` specific case)

This will also help the implementation of correct escaping and `finally` in the compiler.

Pull-Request: #2010
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Tnitter app: fix list layout on GNU/Linux with GTK+
Jean Privat [Sat, 9 Apr 2016 13:57:59 +0000 (09:57 -0400)]
Merge: Tnitter app: fix list layout on GNU/Linux with GTK+

Update GNU/Linux implementation of `ListLayout` to follow the specification of `GtkListBox` which should only have children of type `GtkListBoxRow`. This was an issue in Tnitter where removing children from the `GtkListBox` was broken.

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

8 years agoMerge: More byte digests
Jean Privat [Sat, 9 Apr 2016 13:57:57 +0000 (09:57 -0400)]
Merge: More byte digests

Improve and some back-and-forth transformations between Byte and Text.

~~~nit
var b = "abcd".to_bytes
assert b.chexdigest == "\\x61\\x62\\x63\\x64"
assert b.chexdigest.unescape_to_bytes == b
assert b.binarydigest == "01100001011000100110001101100100"
assert b.binarydigest.binarydigest_to_bytes == b

assert "1".binarydigest_to_bytes.hexdigest == "01"
assert "1 0 1".binarydigest_to_bytes.hexdigest == "05"
assert "7".hexdigest_to_bytes.hexdigest == "07"
assert "a B cd \\xe".hexdigest_to_bytes.hexdigest == "0ABCDE"
~~~

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

8 years agocore/bytes: make Text::hexdigest_to_bytes more permissive
Jean Privat [Sat, 9 Apr 2016 13:56:49 +0000 (09:56 -0400)]
core/bytes: make Text::hexdigest_to_bytes more permissive

It now accepts a odd number of digit and garbage (eg. whitespaces) in
the strings

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

8 years agotests: add base_with_return.res
Jean Privat [Fri, 8 Apr 2016 19:17:46 +0000 (15:17 -0400)]
tests: add base_with_return.res

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

8 years agotests: update line number in test_new_native.nit
Alexis Laferrière [Fri, 8 Apr 2016 16:57:39 +0000 (12:57 -0400)]
tests: update line number in test_new_native.nit

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

8 years agonitc/niti: unify returnmark and escapemark
Jean Privat [Fri, 8 Apr 2016 15:49:23 +0000 (11:49 -0400)]
nitc/niti: unify returnmark and escapemark

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

8 years agonitc/scope: attach AReturnExpr to an escape mark of the whole propdef
Jean Privat [Fri, 8 Apr 2016 15:46:47 +0000 (11:46 -0400)]
nitc/scope: attach AReturnExpr to an escape mark of the whole propdef

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

8 years agonitc/parser: Make `AReturnExpr` an AEscapeExpr
Jean Privat [Fri, 8 Apr 2016 15:45:15 +0000 (11:45 -0400)]
nitc/parser: Make `AReturnExpr` an AEscapeExpr

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

8 years agocontrib/benitlux: fix superstring in benitlux_social
Alexis Laferrière [Wed, 6 Apr 2016 15:40:54 +0000 (11:40 -0400)]
contrib/benitlux: fix superstring in benitlux_social

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

8 years agocontrib/benitlux: let the iterators close the sqlite statements
Alexis Laferrière [Fri, 8 Apr 2016 15:08:41 +0000 (11:08 -0400)]
contrib/benitlux: let the iterators close the sqlite statements

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

8 years agolib/core: fix `Iterator::to_a` not calling `finish`
Alexis Laferrière [Fri, 8 Apr 2016 15:20:17 +0000 (11:20 -0400)]
lib/core: fix `Iterator::to_a` not calling `finish`

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

8 years agolib/sqlite3: protect close statements
Alexis Laferrière [Fri, 8 Apr 2016 12:50:31 +0000 (08:50 -0400)]
lib/sqlite3: protect close statements

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

8 years agolib/sqlite3: fix closing a statement after iterating
Alexis Laferrière [Fri, 8 Apr 2016 11:47:31 +0000 (07:47 -0400)]
lib/sqlite3: fix closing a statement after iterating

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

8 years agocontrib/tnitter: use the new `clear` for a cleaner behavior
Alexis Laferrière [Thu, 7 Apr 2016 17:45:22 +0000 (13:45 -0400)]
contrib/tnitter: use the new `clear` for a cleaner behavior

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

8 years agolib/linux: fix ListBox that should contain only ListBoxRows
Alexis Laferrière [Thu, 7 Apr 2016 17:43:34 +0000 (13:43 -0400)]
lib/linux: fix ListBox that should contain only ListBoxRows

Reported-by: Abdelkarim Belkhir <abdelkarim.belkhir.exalger@viacesi.fr>
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gtk: GtkListBoxRow is a GtkBin
Alexis Laferrière [Thu, 7 Apr 2016 17:43:01 +0000 (13:43 -0400)]
lib/gtk: GtkListBoxRow is a GtkBin

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

8 years agolib/app: intro `CompositeControl::clear`
Alexis Laferrière [Thu, 7 Apr 2016 16:37:36 +0000 (12:37 -0400)]
lib/app: intro `CompositeControl::clear`

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

8 years agocore/bytes: add `Bytes::binarydigest` and `Text::binarydigest_to_bytes`
Jean Privat [Thu, 7 Apr 2016 13:31:07 +0000 (09:31 -0400)]
core/bytes: add `Bytes::binarydigest` and `Text::binarydigest_to_bytes`

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

8 years agocore/bytes: add `Byte::chexdigest`
Jean Privat [Thu, 7 Apr 2016 13:28:46 +0000 (09:28 -0400)]
core/bytes: add `Byte::chexdigest`

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

8 years agoMerge: Augmented literal strings
Jean Privat [Thu, 7 Apr 2016 12:50:34 +0000 (08:50 -0400)]
Merge: Augmented literal strings

As a follow-up to #1991, here's the support mentioned in #1734 for bytestrings, regex and raw strings

NOTE: Depends on #1991 for integration, you may review the last 3 commits while #1991 is reviewed and eventually merged

TODO: Support degraded mode (Bytes and Byte only) for byte SuperStrings instead of refusing at compile-time

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

8 years agoMerge: Friendz: fix missing music file
Jean Privat [Thu, 7 Apr 2016 12:50:29 +0000 (08:50 -0400)]
Merge: Friendz: fix missing music file

This PR moves the music file in the Chainz of Friendz project to the new location of Android specific resources (changed in #1952). This missing file crashed the app at launch on Android.

Also use a Nit constructor/factory to wrap the static Java function `MediaPlayer.create` which is a convenience method acting as a constructor and applying some of the boilerplate code.

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

8 years agoMerge: interpreter: fix rand by leaving rand methods to the FFI
Jean Privat [Thu, 7 Apr 2016 12:50:24 +0000 (08:50 -0400)]
Merge: interpreter: fix rand by leaving rand methods to the FFI

This PR fix `rand` with the interpreter so setting a seed with `srand_from` produces predictable results in the following calls to `rand`, and the same results as the same compiled program. The problem was caused by the interception of `rand` which was executed in the interpreter itself, while `srand_from` was executed on the side of the interpreted program. So setting the seed did not affect in anyway the values returned by `rand`.

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

8 years agoMerge: Benitlux: intro server side of social network
Jean Privat [Thu, 7 Apr 2016 12:50:21 +0000 (08:50 -0400)]
Merge: Benitlux: intro server side of social network

This PR extends the Benitlux web server with a RESTful interface for a social network. This interface will be used by the mobile client, which will be introduced in a future PR.

The new module `benitlux_social` implements all the core logic and SQL request to implement the database. It uses existing services of `benitlux_db` which only keeps track of the beers and their availability.

Most of this code is already deployed on xymus.net and used by the commuNity using the alpha version of the mobile app. Also note that this is the first real-world use of nitrestful, which handles very well all the `restful` methods of `benitlux_controller`.

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

8 years agotests: Added augmented strings test
Lucas Bajolet [Tue, 22 Mar 2016 16:03:18 +0000 (12:03 -0400)]
tests: Added augmented strings test

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

8 years agointerpreter: Added support for prefixed/suffixed strings
Lucas Bajolet [Tue, 22 Mar 2016 16:01:57 +0000 (12:01 -0400)]
interpreter: Added support for prefixed/suffixed strings

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

8 years agocompiler: Added prefixed and suffixed `String` support
Lucas Bajolet [Tue, 22 Mar 2016 15:42:30 +0000 (11:42 -0400)]
compiler: Added prefixed and suffixed `String` support

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

8 years agoxymus.net: update to latest benitlux server features
Alexis Laferrière [Tue, 5 Apr 2016 15:24:55 +0000 (11:24 -0400)]
xymus.net: update to latest benitlux server features

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

8 years agocontrib/benitlux: rename DB to BenitluxDB waiting for working qualified names
Alexis Laferrière [Tue, 5 Apr 2016 15:24:35 +0000 (11:24 -0400)]
contrib/benitlux: rename DB to BenitluxDB waiting for working qualified names

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

8 years agocontrib/benitlux: share a single connexion to the DB
Alexis Laferrière [Mon, 4 Apr 2016 20:26:42 +0000 (16:26 -0400)]
contrib/benitlux: share a single connexion to the DB

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

8 years agolib/sqlite: to_sql_string escape `\`
Alexis Laferrière [Mon, 4 Apr 2016 21:08:52 +0000 (17:08 -0400)]
lib/sqlite: to_sql_string escape `\`

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

8 years agolib/nitcorn: use generate_token in sessions
Alexis Laferrière [Fri, 1 Apr 2016 20:44:58 +0000 (16:44 -0400)]
lib/nitcorn: use generate_token in sessions

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

8 years agocontrib/benitlux: add push notification support
Alexis Laferrière [Fri, 1 Apr 2016 15:58:33 +0000 (11:58 -0400)]
contrib/benitlux: add push notification support

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

8 years agocontrib/benitlux: drop the non-nitrestful service `since/`
Alexis Laferrière [Fri, 1 Apr 2016 15:58:13 +0000 (11:58 -0400)]
contrib/benitlux: drop the non-nitrestful service `since/`

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

8 years agocontrib/benitlux: use nitrestful to expose social network services to clients
Alexis Laferrière [Fri, 1 Apr 2016 15:54:16 +0000 (11:54 -0400)]
contrib/benitlux: use nitrestful to expose social network services to clients

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

8 years agocontrib/benitlux: intro core logic and DB services for a social network
Alexis Laferrière [Fri, 1 Apr 2016 16:02:53 +0000 (12:02 -0400)]
contrib/benitlux: intro core logic and DB services for a social network

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

8 years agocontrib/benitlux: intro shared model objects for a social network
Alexis Laferrière [Sat, 22 Aug 2015 21:35:34 +0000 (17:35 -0400)]
contrib/benitlux: intro shared model objects for a social network

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

8 years agocore/bytes: document hexdigest
Jean Privat [Tue, 5 Apr 2016 04:05:19 +0000 (00:05 -0400)]
core/bytes: document hexdigest

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

8 years agolib/android: Java's `MediaPlayer.create` is a pseudo constructor
Alexis Laferrière [Mon, 4 Apr 2016 17:24:51 +0000 (13:24 -0400)]
lib/android: Java's `MediaPlayer.create` is a pseudo constructor

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

8 years agocontrib/friendz: fix missing sound
Alexis Laferrière [Mon, 4 Apr 2016 17:22:05 +0000 (13:22 -0400)]
contrib/friendz: fix missing sound

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

8 years agointerpreter: do not intercept rand methods
Alexis Laferrière [Mon, 4 Apr 2016 15:07:30 +0000 (11:07 -0400)]
interpreter: do not intercept rand methods

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

8 years agocontrib/benitlux: use print_error to print unexpected errors
Alexis Laferrière [Fri, 1 Apr 2016 15:50:56 +0000 (11:50 -0400)]
contrib/benitlux: use print_error to print unexpected errors

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

8 years agocontrib/benitlux: update pre-existing client of beer_events_today
Alexis Laferrière [Fri, 1 Apr 2016 18:42:08 +0000 (14:42 -0400)]
contrib/benitlux: update pre-existing client of beer_events_today

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

8 years agocontrib/benitlux: fix beer_events_today returning null on error
Alexis Laferrière [Fri, 1 Apr 2016 15:50:16 +0000 (11:50 -0400)]
contrib/benitlux: fix beer_events_today returning null on error

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

8 years agolib/nitcorn: intro a method to generate a random token
Alexis Laferrière [Fri, 1 Apr 2016 20:31:40 +0000 (16:31 -0400)]
lib/nitcorn: intro a method to generate a random token

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

8 years agolib/sqlite3: use less callbacks
Alexis Laferrière [Sun, 25 Oct 2015 17:31:18 +0000 (13:31 -0400)]
lib/sqlite3: use less callbacks

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

8 years agoMerge: Rewrite benchlang
Jean Privat [Thu, 31 Mar 2016 13:59:00 +0000 (09:59 -0400)]
Merge: Rewrite benchlang

This is a major rewrite of the existing but broken `bench_languages` script.

I squashed most of the whole work since a detailed bunch of commits does not make so much sense, just consider it as a new work.

what's new?

* update to lastest eiffel studio thing
* added pypy engine for python
* bench method and attribute access (not only type tests)
* add real polymorphism
* add null bench to test the bottom line
* improved html result

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

8 years agoMerge: Improve `Text::justify` and use it for a pretty `PerfMap::to_s`
Jean Privat [Thu, 31 Mar 2016 13:58:57 +0000 (09:58 -0400)]
Merge: Improve `Text::justify` and use it for a pretty `PerfMap::to_s`

This PR introduces padding services ( `pad_left` and `pad_right`) to `Text` and uses it for a cleaner print in `performance_analysis`.

Seeing how the left-pad package was critical to the node.js ecosystem motivated this PR. These methods should be useful in the long term!

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

8 years agolib/performance_analysis: cleaner output for to_s
Alexis Laferrière [Sun, 27 Mar 2016 00:56:30 +0000 (20:56 -0400)]
lib/performance_analysis: cleaner output for to_s

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

8 years agolib/core: add optional char parameter to `Text::justify`
Alexis Laferrière [Tue, 29 Mar 2016 14:54:55 +0000 (10:54 -0400)]
lib/core: add optional char parameter to `Text::justify`

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

8 years agoMerge: niti: fix escaping in `with`
Jean Privat [Fri, 25 Mar 2016 16:44:09 +0000 (12:44 -0400)]
Merge: niti: fix escaping in `with`

Possible escape flag was let as is in the finish code of a with statement, that caused issues when executing complex code. The correct semantic is to temporarily clear any escape flag while executing the finish.
If an uncatched espace mark is generated while executing the finish, it takes precedence over the possible old one.

Pull-Request: #1997

8 years agoMerge: Fix autoadapt and NULL comparaison
Jean Privat [Fri, 25 Mar 2016 16:44:05 +0000 (12:44 -0400)]
Merge: Fix autoadapt and NULL comparaison

Small fixes in the compilers that mainly triggered bugs on --global but was nevertheless potentially present in other cases.

close #1969

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

8 years agotests: remove sav/nitcg/test_text_stat.res that is now unneded
Jean Privat [Fri, 25 Mar 2016 16:43:05 +0000 (12:43 -0400)]
tests: remove sav/nitcg/test_text_stat.res that is now unneded

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

8 years agoMerge: nitc/transform: maintain vararg information when transforming expressions
Jean Privat [Fri, 25 Mar 2016 13:41:52 +0000 (09:41 -0400)]
Merge: nitc/transform: maintain vararg information when transforming expressions

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

8 years agotests: add base_covar_adapt.nit base_gen_nest.nit to test dead-code adaptations
Jean Privat [Fri, 25 Mar 2016 02:46:35 +0000 (22:46 -0400)]
tests: add base_covar_adapt.nit base_gen_nest.nit to test dead-code adaptations

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

8 years agolib/json/serialization: fix unsafe covariant assignment
Jean Privat [Fri, 25 Mar 2016 02:50:40 +0000 (22:50 -0400)]
lib/json/serialization: fix unsafe covariant assignment

`key = "null"` may abort since `key` is typed by `E`

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

8 years agotests: add base_with2.nit
Jean Privat [Fri, 25 Mar 2016 02:57:55 +0000 (22:57 -0400)]
tests: add base_with2.nit

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

8 years agonitc/globalcomp: avoid looking at unexisting methods
Jean Privat [Fri, 25 Mar 2016 02:31:45 +0000 (22:31 -0400)]
nitc/globalcomp: avoid looking at unexisting methods

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

8 years agonitc/abscomp: cleanup, document and fix autoadapt (no change)
Jean Privat [Fri, 25 Mar 2016 01:27:00 +0000 (21:27 -0400)]
nitc/abscomp: cleanup, document and fix autoadapt (no change)

The fix is do not change the static type on type adaptation!

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

8 years agonitc/abscomp: protect some NULL test with maybenull
Jean Privat [Fri, 25 Mar 2016 00:12:54 +0000 (20:12 -0400)]
nitc/abscomp: protect some NULL test with maybenull

Whereas a potential optimization, this also prevent to generate invalid
C code that compares floats and NULL.

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

8 years agonitc/abscomp: add helper function maybenull to factorize code
Jean Privat [Fri, 25 Mar 2016 00:10:59 +0000 (20:10 -0400)]
nitc/abscomp: add helper function maybenull to factorize code

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

8 years agonitc/transform: maintain vararg information when transforming expressions
Jean Privat [Thu, 24 Mar 2016 23:29:00 +0000 (19:29 -0400)]
nitc/transform: maintain vararg information when transforming expressions

close #1971

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

8 years agobenchmark: complete rewrite of benchlang
Jean Privat [Thu, 24 Mar 2016 22:55:24 +0000 (18:55 -0400)]
benchmark: complete rewrite of benchlang

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

8 years agoniti: fix escaping flag when executing the finish of with
Jean Privat [Thu, 24 Mar 2016 22:44:29 +0000 (18:44 -0400)]
niti: fix escaping flag when executing the finish of with

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

8 years agoMerge: Two trivial rosetta tasks
Jean Privat [Thu, 24 Mar 2016 13:10:51 +0000 (09:10 -0400)]
Merge: Two trivial rosetta tasks

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

8 years agoMerge: lib/core/time: use lightffi for asctime, so niti can run it
Jean Privat [Thu, 24 Mar 2016 13:10:49 +0000 (09:10 -0400)]
Merge: lib/core/time: use lightffi for asctime, so niti can run it

now you can run nitiwiki with the interpreter

Pull-Request: #1993
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: compiler: Added prefix and suffix support for `Char`
Jean Privat [Thu, 24 Mar 2016 13:10:47 +0000 (09:10 -0400)]
Merge: compiler: Added prefix and suffix support for `Char`

As discussed in #1734, here's the PR for the support of prefixed characters.

For now only u and b are supported, respectively to get the code point as an int and the ascii code as a byte.

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

8 years agotets: remove sav/niti//fixme/nitiwiki_args2.res that now pass
Jean Privat [Thu, 24 Mar 2016 13:09:23 +0000 (09:09 -0400)]
tets: remove sav/niti//fixme/nitiwiki_args2.res that now pass

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

8 years agobench_common: do not reexecute failed commands
Jean Privat [Wed, 23 Mar 2016 20:25:56 +0000 (16:25 -0400)]
bench_common: do not reexecute failed commands

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