abstract_compiler: generalize `native_array_instance`

offers the service `native_array_instance` in all compilation engines

Signed-off-by: Jean Privat <jean@pryen.org>
erasure_compiler: remove redefinition of `array_instance`

the inherited implementation from the separate compiler is
enough now that `native_array_instance` is correctly implemented.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: accept intern methods at top-level

This modification does not need a special handling in the model or engines.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: introduce intern `new` constructors (factories)

They are correctly modeled and typed but engines does not how to deal with them.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: regenerate file for improved intern methods

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: special handling of `new NativeArray`

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: accept intern `new` constructors (factories)

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: Accepts `new` constructor on non pointer-based class (eg. NativeString)

Just use with a placebo receiver like in other cases.

Signed-off-by: Jean Privat <jean@pryen.org>
compiler: implement intern `init` on NativeString

Signed-off-by: Jean Privat <jean@pryen.org>
niti: implements intern `init` for NativeString and NativeArray

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

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: Use more intern methods and add intern factories for NativeString and NativeArray

The first commits enhance the parser to accept top-level intern methods (needed for `exit`) and intern `new` factories (analogous to extern `new` factories). Thus fix #493

The rest of the series implements two intern `new` factories, one for NativeString and one for NativeArray.
However, because the compiler in c_src cannot obviously parse the new syntax yet, the standard library is not updated.
So consider the file `test_new_native.nit` as a technology preview.

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