nit.git
8 years agocontrib/jwrapper: update gitignore file
Alexis Laferrière [Mon, 20 Jul 2015 16:48:33 +0000 (12:48 -0400)]
contrib/jwrapper: update gitignore file

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

8 years agocontrib/jwrapper main: revamp entry to support Jar and javap files
Alexis Laferrière [Mon, 20 Jul 2015 12:34:21 +0000 (08:34 -0400)]
contrib/jwrapper main: revamp entry to support Jar and javap files

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

8 years agocontrib/jwrapper main: revamp docs
Alexis Laferrière [Mon, 20 Jul 2015 12:33:59 +0000 (08:33 -0400)]
contrib/jwrapper main: revamp docs

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

8 years agocontrib/jwrapper main: revamp options
Alexis Laferrière [Sun, 19 Jul 2015 16:12:40 +0000 (12:12 -0400)]
contrib/jwrapper main: revamp options

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

8 years agocontrib/jwrapper: generate doc above extern methods
Alexis Laferrière [Mon, 20 Jul 2015 16:26:29 +0000 (12:26 -0400)]
contrib/jwrapper: generate doc above extern methods

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

8 years agocontrib/jwrapper: do not look for existing Nit libs if NIT_DIR is not set
Alexis Laferrière [Mon, 20 Jul 2015 01:20:06 +0000 (21:20 -0400)]
contrib/jwrapper: do not look for existing Nit libs if NIT_DIR is not set

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

8 years agocontrib/jwrapper: avoid Nit keywords and mangle generated method names
Alexis Laferrière [Mon, 20 Jul 2015 03:34:36 +0000 (23:34 -0400)]
contrib/jwrapper: avoid Nit keywords and mangle generated method names

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

8 years agocontrib/jwrapper: refactor `add_identifier`
Alexis Laferrière [Mon, 20 Jul 2015 02:48:40 +0000 (22:48 -0400)]
contrib/jwrapper: refactor `add_identifier`

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

8 years agocontrib/jwrapper: use the prefix `Java`
Alexis Laferrière [Mon, 20 Jul 2015 02:45:55 +0000 (22:45 -0400)]
contrib/jwrapper: use the prefix `Java`

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

8 years agocontrib/jwrapper: minor style update in model
Alexis Laferrière [Mon, 20 Jul 2015 02:45:11 +0000 (22:45 -0400)]
contrib/jwrapper: minor style update in model

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

8 years agocontrib/jwrapper: support wildcards with a default bound
Alexis Laferrière [Mon, 20 Jul 2015 02:49:06 +0000 (22:49 -0400)]
contrib/jwrapper: support wildcards with a default bound

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

8 years agocontrib/jwrapper: main logic use `JavaModel` and support many files at once
Alexis Laferrière [Sun, 19 Jul 2015 20:01:36 +0000 (16:01 -0400)]
contrib/jwrapper: main logic use `JavaModel` and support many files at once

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

8 years agocontrib/jwrapper: intro `JavaModel`
Alexis Laferrière [Sun, 19 Jul 2015 17:24:19 +0000 (13:24 -0400)]
contrib/jwrapper: intro `JavaModel`

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

8 years agocontrib/jwrapper: revamp `gen_licence` to be more customizable
Alexis Laferrière [Sun, 19 Jul 2015 17:25:22 +0000 (13:25 -0400)]
contrib/jwrapper: revamp `gen_licence` to be more customizable

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

8 years agocontrib/jwrapper: use a MultiHashMap to store methods and their signatures
Alexis Laferrière [Sun, 19 Jul 2015 16:38:41 +0000 (12:38 -0400)]
contrib/jwrapper: use a MultiHashMap to store methods and their signatures

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

8 years agocontrib/jwrapper: separate comment vs stubs in generator logic
Alexis Laferrière [Sun, 19 Jul 2015 16:10:49 +0000 (12:10 -0400)]
contrib/jwrapper: separate comment vs stubs in generator logic

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

8 years agocontrib/jwrapper: update constructors of `CodeGenerator` and `JavapVisitor`
Alexis Laferrière [Sun, 19 Jul 2015 16:08:09 +0000 (12:08 -0400)]
contrib/jwrapper: update constructors of `CodeGenerator` and `JavapVisitor`

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

8 years agocontrib/jwrapper: remove illegal attribute generation
Alexis Laferrière [Sun, 19 Jul 2015 16:05:16 +0000 (12:05 -0400)]
contrib/jwrapper: remove illegal attribute generation

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

8 years agocontrib/jwrapper: fix parameter-less methods right after the constructor
Alexis Laferrière [Mon, 20 Jul 2015 00:19:28 +0000 (20:19 -0400)]
contrib/jwrapper: fix parameter-less methods right after the constructor

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

8 years agocontrib/jwrapper grammar: fix generic types parameters with bounds
Alexis Laferrière [Mon, 20 Jul 2015 11:12:09 +0000 (07:12 -0400)]
contrib/jwrapper grammar: fix generic types parameters with bounds

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

8 years agocontrib/jwrapper grammar: accept generic constructors
Alexis Laferrière [Mon, 20 Jul 2015 11:11:48 +0000 (07:11 -0400)]
contrib/jwrapper grammar: accept generic constructors

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

8 years agocontrib/jwrapper grammar: eat the strictfp keyword
Alexis Laferrière [Mon, 20 Jul 2015 11:11:24 +0000 (07:11 -0400)]
contrib/jwrapper grammar: eat the strictfp keyword

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

8 years agocontrib/jwrapper grammar: accept `-` in Java identifier, it can be used internally
Alexis Laferrière [Mon, 20 Jul 2015 05:08:33 +0000 (01:08 -0400)]
contrib/jwrapper grammar: accept `-` in Java identifier, it can be used internally

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

8 years agocontrib/jwrapper grammar: accept classes compiled from any file name
Alexis Laferrière [Mon, 20 Jul 2015 05:07:48 +0000 (01:07 -0400)]
contrib/jwrapper grammar: accept classes compiled from any file name

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

8 years agocontrib/jwrapper grammar: fix parsing many files at once
Alexis Laferrière [Mon, 20 Jul 2015 05:07:16 +0000 (01:07 -0400)]
contrib/jwrapper grammar: fix parsing many files at once

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

8 years agocontrib/jwrapper grammar: fix `implements` and `extends` behavior
Alexis Laferrière [Mon, 20 Jul 2015 01:17:16 +0000 (21:17 -0400)]
contrib/jwrapper grammar: fix `implements` and `extends` behavior

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

8 years agocontrib/jwrapper grammar: accept wildcards in generic parameters
Alexis Laferrière [Mon, 20 Jul 2015 01:16:45 +0000 (21:16 -0400)]
contrib/jwrapper grammar: accept wildcards in generic parameters

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

8 years agocontrib/jwrapper grammar: style clean up
Alexis Laferrière [Mon, 20 Jul 2015 00:17:35 +0000 (20:17 -0400)]
contrib/jwrapper grammar: style clean up

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

8 years agolib/performance_analysis: keep the sum execution time
Alexis Laferrière [Mon, 20 Jul 2015 04:17:57 +0000 (00:17 -0400)]
lib/performance_analysis: keep the sum execution time

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

8 years agolib/performance_analysis: fix `PerfMap::to_s`
Alexis Laferrière [Mon, 20 Jul 2015 04:17:31 +0000 (00:17 -0400)]
lib/performance_analysis: fix `PerfMap::to_s`

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

8 years agolib/opts: improve doc of `OptionEnum`
Alexis Laferrière [Sun, 19 Jul 2015 19:51:59 +0000 (15:51 -0400)]
lib/opts: improve doc of `OptionEnum`

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

8 years agoMerge: Basic UDP socket
Jean Privat [Mon, 20 Jul 2015 13:34:10 +0000 (09:34 -0400)]
Merge: Basic UDP socket

This PR intro `UDPSocket` and cleans up a bit of the native layer of socket to avoid using callbacks when possible.

`UDPSocket` support sending messages to remote sockets without a connection and more importantly receive message from any sender. However, as of yet it does not support connections or the stream API of Nit.

Some TODO with the sockets:
* Stop using `gethostbyname` :neutral_face:
* Decide on one or many APIs. The native layer has an API closed to the C API and to what is available in other languages, maybe it can be clean up further and exposed as is.

---
Please ignore the first 2 commits from #1573.

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

8 years agoMerge: Faster write
Jean Privat [Mon, 20 Jul 2015 13:34:04 +0000 (09:34 -0400)]
Merge: Faster write

Allow FlatString to be directly written to files without useless copy (`to_cstring`) or useless iterator (`substrings`)

Numbers, for `nitc nitc.nit`:

* before 5.796
* after 5.440 (-6%)

Close one check-box of #1298

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

8 years agoMerge: Apply optional params in strip_extension, basename and join
Jean Privat [Mon, 20 Jul 2015 13:33:45 +0000 (09:33 -0400)]
Merge: Apply optional params in strip_extension, basename and join

Using optional parameters, the methods `strip_extension`, `basename` and `join` have a default behavior that fit most usage.

* `Collection::join` appends all elements of the collection by default, the same as `join("")`. This is the old behavior of `Collection::to_s`.

* `String::strip_extension` removes the rightmost extension by default, the same as `s.strip_extension("." + s.file_extension)`.

* `String::basename` does not strip the extension by default.

I haven't updated any users of `strip_extension` because the default behavior requires more work. Thus changing the already existing calls to something else would slow down the programs by a very small margin.

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

8 years agosrc & lib: use the default behavior of `basename` where applicable
Alexis Laferrière [Sat, 18 Jul 2015 13:43:53 +0000 (09:43 -0400)]
src & lib: use the default behavior of `basename` where applicable

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

8 years agolib/standard: revamp doc of `Map::join`
Alexis Laferrière [Fri, 17 Jul 2015 14:09:59 +0000 (10:09 -0400)]
lib/standard: revamp doc of `Map::join`

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

8 years agocontrib & examples..: update users of `join("")`
Alexis Laferrière [Fri, 17 Jul 2015 14:01:23 +0000 (10:01 -0400)]
contrib & examples..: update users of `join("")`

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

8 years agolib/standard: the single parameter of `String::basename` is optional
Alexis Laferrière [Fri, 17 Jul 2015 13:29:12 +0000 (09:29 -0400)]
lib/standard: the single parameter of `String::basename` is optional

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

8 years agoMerge: Protected setters
Jean Privat [Sat, 18 Jul 2015 01:42:35 +0000 (21:42 -0400)]
Merge: Protected setters

Setters of attributes are private by default. This cause some issue as they are exposed as initializers but still invisible in client modules.
The proposed solution to resolve this inconsistency is to make setters protected by default so they are visible in client modules but only usable in subclasses.

This is a change is the spec, to RFC label is set is people have comments on the sanity/usability/kiss/pola/etc.

Close #1552

Pull-Request: #1567
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: Fix autosuperinit
Jean Privat [Sat, 18 Jul 2015 01:41:54 +0000 (21:41 -0400)]
Merge: Fix autosuperinit

Rules are that a named constructor is expected to call super or the autosuperinit in order to be sanely attached to the inheritance hierarchy. If no such a call exists, an implicit call is injected (thus the name auto-super-init) or an error is displayed.

For some historical reasons, the rule was only enforced when a class inherits a concrete or a abstract class. But this restriction is buggy with the last spec of autoinit constructors.

The main change in src/ is just to remove the test the skip the work.
All other changes in the code are to enforce the rule (not that much); basically this means calling init with parameters instead of assigning attributes.
The remaining changes is to update the sav files because missing autosuperinit are now correctly injected.

Close #1550

Pull-Request: #1566
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agoMerge: lib/noise: compatibility with 32 bits arch and noisier
Jean Privat [Fri, 17 Jul 2015 21:03:25 +0000 (17:03 -0400)]
Merge: lib/noise: compatibility with 32 bits arch and noisier

This PR enables using noise maps in multiplayer multiplatform games.

The integers are limited to 30 bits in length to be compatible with 32 bits architectures with 2 bits for tagging. Forcing this limit allows to get the same results from the same seed on a 32 and 64 bits computers.

The random angle generation is better than previously, the repeated checker pattern is no more. However there is still a visible patterns on the main axes. Further work is need to fix it.

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

8 years agoMerge: Rename Container to Ref
Jean Privat [Fri, 17 Jul 2015 21:03:18 +0000 (17:03 -0400)]
Merge: Rename Container to Ref

The `Container` class is widely misunderstood and underused.  However it can be very useful to implement a return parameter. This PR rename the class according to this usage. It will make some signatures easier to understand: (example inspired by a similar function from `UDPSocket`)

~~~nit
# This method has 3 outputs:
# * The received message written into `buffer`.
# * The number of bytes written as the return value.
# * The information on the sender of the message is stored in `sender_info`.
fun recv_from(buffer: NativeString, sender_info: Ref[nullable SocketAddress]): Int
~~~

### Bonus Ref tip!

`Ref` can also be used as a hackish equivalent to a `static` variable in C. This example use the dreaded `once` keyword to easily get a singleton, but it could be done cleaner with an attribute in `Sys`.

~~~nit
fun foo
   ...

    # Count the number of times foo is executed
    var counter = once new Ref[Int](0)
    counter.item += 1
    print "foo has been executed {counter.item} times"
end
~~~

Pull-Request: #1573
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Separate code compilation for autobox
Jean Privat [Fri, 17 Jul 2015 21:03:12 +0000 (17:03 -0400)]
Merge: Separate code compilation for autobox

`autobox` (and and its cousin `autobox_extern`) where using RTA information when generating code in order to avoiding to use a C symbol (like a table identifier) that will not be defined in the final compiled program.

The problem is that the approach is incompatible with separate compilation principle where the generated code is independent or the program (thus independent of the liveness of the types of a given program).

The solution is to use symbols in the separate compilation, even for potential (or known) dead classes, and let the global phase define these symbols with invalid information.

Pull-Request: #1570
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agotests: update deserializations tests with nitce because fixed autoinit fix things
Jean Privat [Fri, 17 Jul 2015 20:55:52 +0000 (16:55 -0400)]
tests: update deserializations tests with nitce because fixed autoinit fix things

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

8 years agoniti: update intern implementation of `io_write`.
Jean Privat [Fri, 17 Jul 2015 20:31:37 +0000 (16:31 -0400)]
niti: update intern implementation of `io_write`.

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

8 years agolib/noise: fix generation of generated pseudo-random angles
Alexis Laferrière [Mon, 13 Jul 2015 16:01:17 +0000 (12:01 -0400)]
lib/noise: fix generation of generated pseudo-random angles

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

8 years agolib/noise: make compatible with 32 bit archs and a bit more random
Alexis Laferrière [Wed, 8 Jul 2015 19:50:19 +0000 (15:50 -0400)]
lib/noise: make compatible with 32 bit archs and a bit more random

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

8 years agolib/noise: fix the expected amplitude of the pseudo random value to be in [-1.0 ...
Alexis Laferrière [Thu, 2 Jul 2015 04:57:04 +0000 (00:57 -0400)]
lib/noise: fix the expected amplitude of the pseudo random value to be in [-1.0 .. 1.0]

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

8 years agolib/standard: the single parameter of `String::strip_extension` is optional
Alexis Laferrière [Fri, 17 Jul 2015 13:29:02 +0000 (09:29 -0400)]
lib/standard: the single parameter of `String::strip_extension` is optional

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

8 years agolib/standard: the single parameter of `Collection::join` is optional
Alexis Laferrière [Sat, 11 Jul 2015 17:25:22 +0000 (13:25 -0400)]
lib/standard: the single parameter of `Collection::join` is optional

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

8 years agolib/socket: intro `UDPSocket` and its services
Alexis Laferrière [Mon, 13 Jul 2015 16:46:28 +0000 (12:46 -0400)]
lib/socket: intro `UDPSocket` and its services

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

8 years agolib/socket: add UDP related services to the native layer
Alexis Laferrière [Sun, 5 Jul 2015 17:53:48 +0000 (13:53 -0400)]
lib/socket: add UDP related services to the native layer

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

8 years agolib/socket: refactor IOError from errnos into contructors
Alexis Laferrière [Tue, 14 Jul 2015 11:25:37 +0000 (07:25 -0400)]
lib/socket: refactor IOError from errnos into contructors

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

8 years agolib & examples & tests: update all the many and happy users of the new Ref
Alexis Laferrière [Fri, 17 Jul 2015 12:08:48 +0000 (08:08 -0400)]
lib & examples & tests: update all the many and happy users of the new Ref

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

8 years agolib/socket: move `blocking=` to `Socket`
Alexis Laferrière [Sun, 5 Jul 2015 17:52:13 +0000 (13:52 -0400)]
lib/socket: move `blocking=` to `Socket`

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

8 years agolib/collection: rename Container to Ref
Alexis Laferrière [Fri, 17 Jul 2015 12:07:56 +0000 (08:07 -0400)]
lib/collection: rename Container to Ref

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

8 years agolib/socket: intro `TCPSocket`
Alexis Laferrière [Sun, 5 Jul 2015 17:51:50 +0000 (13:51 -0400)]
lib/socket: intro `TCPSocket`

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

8 years agolib/socket: write and read of the native layer use a user-created buffer
Alexis Laferrière [Mon, 6 Jul 2015 14:16:45 +0000 (10:16 -0400)]
lib/socket: write and read of the native layer use a user-created buffer

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

8 years agolib/socket: revamp services of `NativeSocketAddrIn`
Alexis Laferrière [Sun, 5 Jul 2015 17:54:22 +0000 (13:54 -0400)]
lib/socket: revamp services of `NativeSocketAddrIn`

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

8 years agolib/socket: use less callbacks and prefer NativeString in the native layer
Alexis Laferrière [Sun, 5 Jul 2015 13:40:34 +0000 (09:40 -0400)]
lib/socket: use less callbacks and prefer NativeString in the native layer

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

8 years agolib/socket: rename `Socket::socket` to `Socket::native`
Alexis Laferrière [Sun, 5 Jul 2015 13:38:33 +0000 (09:38 -0400)]
lib/socket: rename `Socket::socket` to `Socket::native`

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

8 years agolib/file: efficient write to file for FlatString
Jean Privat [Thu, 16 Jul 2015 21:06:20 +0000 (17:06 -0400)]
lib/file: efficient write to file for FlatString

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

8 years agolib/file: delegate how to write a string to the string itself
Jean Privat [Thu, 16 Jul 2015 21:05:42 +0000 (17:05 -0400)]
lib/file: delegate how to write a string to the string itself

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

8 years agolib/file: add a `from` parameter on `write_native` and `io_write`
Jean Privat [Thu, 16 Jul 2015 21:04:59 +0000 (17:04 -0400)]
lib/file: add a `from` parameter on `write_native` and `io_write`

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

8 years agoMerge: Fix bug with reverse iterators in arrays
Jean Privat [Thu, 16 Jul 2015 15:35:41 +0000 (11:35 -0400)]
Merge: Fix bug with reverse iterators in arrays

Using `Array::iterator` after a finished `reverse_iterator` iterates only on the first element, or crash if array is empty. As `ReverseArrayIterator` specialize `ArrayIterator`, it can cache itself in the array to be used by `iterator`.

This PR simply disable caching for reverse iterators. We could add a distinct cache for the reverse iterator if we need the performance.

This minimal program highlights the bug:
~~~nit
var a = [1, 2, 3]
for x in a.reverse_iterator do print x
print "-"
for x in a.iterator do print x
~~~

Output:
~~~
3
2
1
-
1
~~~

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

8 years agosep_comp: do not lose potential mcasttype information in autobox
Jean Privat [Thu, 16 Jul 2015 15:18:40 +0000 (11:18 -0400)]
sep_comp: do not lose potential mcasttype information in autobox

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

8 years agosep_comp: do not rely on RTA in autobox
Jean Privat [Thu, 16 Jul 2015 15:18:05 +0000 (11:18 -0400)]
sep_comp: do not rely on RTA in autobox

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

8 years agosep_comp: improve deadness management in compile_class_to_c
Jean Privat [Thu, 16 Jul 2015 15:16:56 +0000 (11:16 -0400)]
sep_comp: improve deadness management in compile_class_to_c

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

8 years agotests: update line number in `test_new_native_alt1`
Alexis Laferrière [Thu, 16 Jul 2015 03:02:03 +0000 (23:02 -0400)]
tests: update line number in `test_new_native_alt1`

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

8 years agolib/array: do not cache reverse iterators as forward iterators
Alexis Laferrière [Wed, 15 Jul 2015 20:56:42 +0000 (16:56 -0400)]
lib/array: do not cache reverse iterators as forward iterators

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

8 years agoMerge: Better autoinit conflict message
Jean Privat [Tue, 14 Jul 2015 19:50:57 +0000 (15:50 -0400)]
Merge: Better autoinit conflict message

On

~~~nit
class A
    var x: Int
end

class B
    var y: Bool
end

class C
    super A
    super B
end
~~~

The error message

> a.nit:9,7: Error: conflict for inherited inits a#B#init(y=) and a#A#init(x=)

now become

> a.nit:9,7: Error: cannot generate automatic init for class C. Conflict in the order in inherited initializers a#B#init(y=) and a#A#init(x=). Use `autoinit` to order initializers. eg `autoinit x=, y=`

(fell free to simplify or propose better)

Close #1549

Pull-Request: #1568
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agolib/neo4j: use `nosuper` in named constructors to avoid the initialization of `intern...
Jean Privat [Tue, 14 Jul 2015 14:37:48 +0000 (10:37 -0400)]
lib/neo4j: use `nosuper` in named constructors to avoid the initialization of `internal_properties`

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

8 years agolib/geometry: named constructors use autoinit
Jean Privat [Tue, 14 Jul 2015 12:33:07 +0000 (08:33 -0400)]
lib/geometry: named constructors use autoinit

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

8 years agolib/date: named constructors use autoinit
Jean Privat [Tue, 14 Jul 2015 12:32:32 +0000 (08:32 -0400)]
lib/date: named constructors use autoinit

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

8 years agoMerge: lib/standard/bytes: Added pop method
Jean Privat [Mon, 13 Jul 2015 20:24:58 +0000 (16:24 -0400)]
Merge: lib/standard/bytes: Added pop method

The method was missing from Bytes, I needed it so I implemented it, and here's the associated PR.

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

8 years agoMerge: Rosetta entropy
Jean Privat [Mon, 13 Jul 2015 20:24:46 +0000 (16:24 -0400)]
Merge: Rosetta entropy

Pull-Request: #1561
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agorefund: `Dollar::from_float` use the autoinit constructor
Jean Privat [Mon, 13 Jul 2015 20:04:51 +0000 (16:04 -0400)]
refund: `Dollar::from_float` use the autoinit constructor

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

8 years agonitrpg: `from_json` constructors use the autoinit constructor
Jean Privat [Mon, 13 Jul 2015 20:04:24 +0000 (16:04 -0400)]
nitrpg: `from_json` constructors use the autoinit constructor

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

8 years agonitcc: make the autoinit constructor of Automation without parameter
Jean Privat [Mon, 13 Jul 2015 20:03:44 +0000 (16:03 -0400)]
nitcc: make the autoinit constructor of Automation without parameter

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

8 years agotests: update (and improve) test for autoinit error message
Jean Privat [Mon, 13 Jul 2015 19:33:45 +0000 (15:33 -0400)]
tests: update (and improve) test for autoinit error message

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

8 years agomodelize: improve message in case of inherited autoinit conflict
Jean Privat [Mon, 13 Jul 2015 19:32:58 +0000 (15:32 -0400)]
modelize: improve message in case of inherited autoinit conflict

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

8 years agotests: update sav for nuew setter visibility rule
Jean Privat [Mon, 13 Jul 2015 18:16:53 +0000 (14:16 -0400)]
tests: update sav for nuew setter visibility rule

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

8 years agomodelize_property: setters are protected by default so are visible to use in setters
Jean Privat [Mon, 13 Jul 2015 18:16:18 +0000 (14:16 -0400)]
modelize_property: setters are protected by default so are visible to use in setters

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

8 years agolib/standard/bytes: added documentation for public methods
Lucas Bajolet [Mon, 13 Jul 2015 17:12:31 +0000 (13:12 -0400)]
lib/standard/bytes: added documentation for public methods

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

8 years agotests: update sav for enforced superautoinit
Jean Privat [Mon, 13 Jul 2015 16:44:12 +0000 (12:44 -0400)]
tests: update sav for enforced superautoinit

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

8 years agoautosuperinit: constructors can be defined in interface, so autosuperinit should...
Jean Privat [Mon, 13 Jul 2015 15:40:30 +0000 (11:40 -0400)]
autosuperinit: constructors can be defined in interface, so autosuperinit should search for them

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

8 years agotests: update example_hanoi with saner constructor
Jean Privat [Mon, 13 Jul 2015 16:43:24 +0000 (12:43 -0400)]
tests: update example_hanoi with saner constructor

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

8 years agosrc/niti: PrimitiveNativeFile use autoinit in named inits
Jean Privat [Mon, 13 Jul 2015 16:42:31 +0000 (12:42 -0400)]
src/niti: PrimitiveNativeFile use autoinit in named inits

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

8 years agolib/sqlite3: use autoinit in named init `open`
Jean Privat [Mon, 13 Jul 2015 16:41:43 +0000 (12:41 -0400)]
lib/sqlite3: use autoinit in named init `open`

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

8 years agolib/noise: all classes are serializable
Alexis Laferrière [Tue, 7 Jul 2015 12:06:23 +0000 (08:06 -0400)]
lib/noise: all classes are serializable

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

8 years agosrc/location: use `nosuper in some specific named constructors
Jean Privat [Mon, 13 Jul 2015 15:38:19 +0000 (11:38 -0400)]
src/location: use `nosuper in some specific named constructors

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

8 years agolib/string: named constructors call the autoinit explicitly
Jean Privat [Mon, 13 Jul 2015 15:37:48 +0000 (11:37 -0400)]
lib/string: named constructors call the autoinit explicitly

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

8 years agolib/standard/bytes: Added pop method
Lucas Bajolet [Mon, 13 Jul 2015 14:45:18 +0000 (10:45 -0400)]
lib/standard/bytes: Added pop method

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

8 years agorosetta code: also add fibonacci_word
Jean Privat [Fri, 10 Jul 2015 15:59:29 +0000 (11:59 -0400)]
rosetta code: also add fibonacci_word

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

8 years agorosetta code: also add entropy_narcissist
Jean Privat [Fri, 10 Jul 2015 15:43:32 +0000 (11:43 -0400)]
rosetta code: also add entropy_narcissist

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

8 years agorosetta code: entropy
Jean Privat [Fri, 10 Jul 2015 15:24:15 +0000 (11:24 -0400)]
rosetta code: entropy

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

8 years agolib/counter: add `Counter::entropy` to shine in private dinners in town
Jean Privat [Fri, 10 Jul 2015 15:24:00 +0000 (11:24 -0400)]
lib/counter: add `Counter::entropy` to shine in private dinners in town

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

8 years agolib/counter: add `Collection::to_counter` to simplify the creation of counterss
Jean Privat [Fri, 10 Jul 2015 15:20:28 +0000 (11:20 -0400)]
lib/counter: add `Collection::to_counter` to simplify the creation of counterss

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

8 years agoMerge: Tweaks to the Android support
Jean Privat [Fri, 10 Jul 2015 13:55:31 +0000 (09:55 -0400)]
Merge: Tweaks to the Android support

Fixes multi-pointers support, intro `NativeActivity::finish`, landscape mode use the sensor and find the assets folder using the project location.

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

8 years agolib/android: intro `NativeActivity::finish`
Alexis Laferrière [Sun, 5 Jul 2015 17:50:22 +0000 (13:50 -0400)]
lib/android: intro `NativeActivity::finish`

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