Merge: nitgg: use is_toplevel instead of heuristics to not customize top-level methods

Pull-Request: #671
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
auto_super_init: add annotation `nosuper`

Signed-off-by: Jean Privat <jean@pryen.org>
tests: add base_init_nosuper.nit

Signed-off-by: Jean Privat <jean@pryen.org>
lib: prepare for new constructors

Signed-off-by: Jean Privat <jean@pryen.org>
contrib: prepare for new constructors

Signed-off-by: Jean Privat <jean@pryen.org>
src: prepare for new constructors

Signed-off-by: Jean Privat <jean@pryen.org>
tests: prepare for new constructors

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update sav for modified files

Signed-off-by: Jean Privat <jean@pryen.org>
lib: make Seq::append an alias of add_all (instead of relying on an inefficient default implementation)

Signed-off-by: Jean Privat <jean@pryen.org>
lib: add Seq:insert_all as a generalized `insert`

Signed-off-by: Jean Privat <jean@pryen.org>
lib: add Seq:prepend as an alias of `insert_all(0)`

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Fixes for supercalls

A bug was found while working on the new constructors.

Pull-Request: #672
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Merge: Annotation `nosuper` to avoid automatic super call in constructors

A super-init-call is automatically added in constructors that do not invoke one (a la java)
But sometimes one may want to avoid calling a super-init.

Before, this could be done with a dead super

~~~
init do
  if false the super # a super is present, so no additional implicit super-init
  rest
end
~~~

Now, one can just write

~~~
init is nosuper do
   rest
end
~~~

that is more KISS I think.

Pull-Request: #673
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Merge: Prepare for new constructors

With new constructors, attributes without default value are considered even if a constructor is present.

So, while ugly, the following code is currently working.
~~~
class A
   var attr: Attr
   init do attr = new Attr(foo)
end
var a = new A
~~~

With the new constructors, the attribute `attr` will be part of the signature of the new,

~~~
var a = new A # Error, expected one argument `attr: Attr`
~~~

So this series do some cosmetic changes to accommodate the future new constructors.
Most of these change make senes own their own since they:

* reduce the number of lines by removing useless init
* clarify the behavior of some attributes by adding a default value or a `noinit` annotation

More precisely, easy cases of the previous code is usually migrated into

~~~
class A
   var attr = new Attr(foo)
end
var a = new A
~~~

And complex cases into

~~~
class A
   var attr: Attr is noinit
   init do attr = new Attr(foo)
end
var a = new A
~~~

The few remaining very complex cases (ex parser) will be migrated latter, and a temporally new annotation `old_style_init` may be created for them.

Pull-Request: #674
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: update sav/test_new_native_alt1.res because of changes in array.nit

Signed-off-by: Jean Privat <jean@pryen.org>
auto_super_init: handle the case of constructors redefinition (instead of infinitively recurse)

Signed-off-by: Jean Privat <jean@pryen.org>
tests: add base_init_super_call3.nit and it does not stack-overflow

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: introduce Sequence::prepend

How could people live without having a working prepend?

Pull-Request: #675
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/string_exp/utf8_noindex: Added two-way iterators for FlatString

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/string_exp/utf8_noindex: Added cache for last access.

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