nit.git
11 years agonitg-s/-e: avoid compilation of emtpy vt/ft/unanchored structs.
Alexandre Terrasa [Sun, 9 Dec 2012 22:08:35 +0000 (17:08 -0500)]
nitg-s/-e: avoid compilation of emtpy vt/ft/unanchored structs.

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

11 years agonitg-s: merged fts, vts and unanchored struct types representations.
Alexandre Terrasa [Sun, 9 Dec 2012 21:17:51 +0000 (16:17 -0500)]
nitg-s: merged fts, vts and unanchored struct types representations.

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

11 years agonitg-s: reorder struct type fields
Alexandre Terrasa [Sun, 9 Dec 2012 21:05:23 +0000 (16:05 -0500)]
nitg-s: reorder struct type fields

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

11 years agonitg-s: introduce unanchored resolution tables.
Alexandre Terrasa [Sun, 9 Dec 2012 20:59:24 +0000 (15:59 -0500)]
nitg-s: introduce unanchored resolution tables.

Unanchored resolution tables allow the compiler to retrieve at runtime a live generic type with given formal types
Old tree based resolution structure with tree is now an option of nitg (--generic-resolution-tree)

Options --bm-typing and --ph*-typing affects the unanchored tables generations.

Updated nitg.res with new option. Also added tests in makefile.

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

11 years agoMerge remote-tracking branch 'alexandre/master'
Jean Privat [Sun, 9 Dec 2012 06:38:43 +0000 (01:38 -0500)]
Merge remote-tracking branch 'alexandre/master'

11 years agotests: add test_array_formal.nit
Jean Privat [Sun, 9 Dec 2012 05:33:26 +0000 (00:33 -0500)]
tests: add test_array_formal.nit

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

11 years agotests: add base_virtual_type_variance.nit
Jean Privat [Sun, 9 Dec 2012 05:31:13 +0000 (00:31 -0500)]
tests: add base_virtual_type_variance.nit

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

11 years agotests: add base_attr_boxing.nit
Jean Privat [Sun, 9 Dec 2012 05:24:53 +0000 (00:24 -0500)]
tests: add base_attr_boxing.nit

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

11 years agonitg-e: add option --no-check-erasure-cast to disable erasure-casts
Jean Privat [Sun, 9 Dec 2012 03:58:25 +0000 (22:58 -0500)]
nitg-e: add option --no-check-erasure-cast to disable erasure-casts

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

11 years agonitg-e: implements erasure-cast
Jean Privat [Sun, 9 Dec 2012 03:40:59 +0000 (22:40 -0500)]
nitg-e: implements erasure-cast

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

11 years agotyping: add CallSite::erasure_cast to indicate if a cast may be required
Jean Privat [Sun, 9 Dec 2012 03:37:38 +0000 (22:37 -0500)]
typing: add CallSite::erasure_cast to indicate if a cast may be required

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

11 years agonitg: add v.compile_callsite to generate the send associated to a CallSite instances
Jean Privat [Sun, 9 Dec 2012 03:36:50 +0000 (22:36 -0500)]
nitg: add v.compile_callsite to generate the send associated to a CallSite instances

The point of this method is to extends the CallSite concept
to the compiler.

A future commit will redefine compile_callsite method to add erasure-casts.

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

11 years agotyping: attach CallSite instances to AST nodes
Jean Privat [Sun, 9 Dec 2012 03:26:58 +0000 (22:26 -0500)]
typing: attach CallSite instances to AST nodes

Instead of having some partial information, just attach the whole thing.
Previous partial information is tagged @depreciated

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

11 years agonitg-s: retrieve recursively all partial generic types
Alexandre Terrasa [Sun, 9 Dec 2012 01:25:43 +0000 (20:25 -0500)]
nitg-s: retrieve recursively all partial generic types

for new G[H[nullable T], Object] and T: X
nitg-s will now find :
G[H[nullable X], Object]
H[nullable X]
nullable X
Object
as type to generate.

H[nullable X] and nullable X are considered as partial type because they are only used as part of a generic livetype.

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

11 years agotyping: new class CallSite
Jean Privat [Sun, 9 Dec 2012 01:24:07 +0000 (20:24 -0500)]
typing: new class CallSite

This class is used to combine information on a specific call site.

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

11 years agonitg-s: add cast to remove c warnings
Alexandre Terrasa [Sun, 9 Dec 2012 00:28:07 +0000 (19:28 -0500)]
nitg-s: add cast to remove c warnings

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

11 years agobenchs: add entry for nitg-e with inline colors, bm, phmod and phand
Alexandre Terrasa [Sat, 8 Dec 2012 23:29:28 +0000 (18:29 -0500)]
benchs: add entry for nitg-e with inline colors, bm, phmod and phand

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

11 years agotests: add goals in makefile for nitg-s/-e with --bm-typing --phmod-typing and -...
Alexandre Terrasa [Sat, 8 Dec 2012 23:18:24 +0000 (18:18 -0500)]
tests: add goals in makefile for nitg-s/-e with --bm-typing --phmod-typing and --phand-typing

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

11 years agotests: update option list for nitg, nitg-s & nitg-e
Alexandre Terrasa [Sat, 8 Dec 2012 23:12:10 +0000 (18:12 -0500)]
tests: update option list for nitg, nitg-s & nitg-e

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

11 years agocoloring: replace static bound of OrderedSet[nullable Object] with Object
Alexandre Terrasa [Sat, 8 Dec 2012 23:11:30 +0000 (18:11 -0500)]
coloring: replace static bound of OrderedSet[nullable Object] with Object

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

11 years agonitg-s/-e: rename c variable "type" in body function to avoid conflicts with paramete...
Alexandre Terrasa [Sat, 8 Dec 2012 22:56:18 +0000 (17:56 -0500)]
nitg-s/-e: rename c variable "type" in body function to avoid conflicts with parameter names

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

11 years agoMerge remote-tracking branch 'github-privat/master'
Alexandre Terrasa [Sat, 8 Dec 2012 22:12:13 +0000 (17:12 -0500)]
Merge remote-tracking branch 'github-privat/master'

11 years agonitg-s: introduce formal type perfect hashing
Alexandre Terrasa [Sat, 8 Dec 2012 21:39:09 +0000 (16:39 -0500)]
nitg-s: introduce formal type perfect hashing

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

11 years agonitg-s/-e: introduce virtual type perfect hashing
Alexandre Terrasa [Sat, 8 Dec 2012 21:07:11 +0000 (16:07 -0500)]
nitg-s/-e: introduce virtual type perfect hashing

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

11 years agonitg-s: limit table access by factoring c code
Alexandre Terrasa [Sat, 8 Dec 2012 07:02:43 +0000 (02:02 -0500)]
nitg-s: limit table access by factoring c code

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

11 years agonitg-s: instantiate the right array in case of unresolved elttype
Jean Privat [Sat, 8 Dec 2012 05:56:58 +0000 (00:56 -0500)]
nitg-s: instantiate the right array in case of unresolved elttype

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

11 years agonitg-s/-e: make typing related option names simpler
Alexandre Terrasa [Sat, 8 Dec 2012 05:26:45 +0000 (00:26 -0500)]
nitg-s/-e: make typing related option names simpler

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

11 years agonitg-s: option --use-naive-coloring now affects FT, VT and livegen fabrics coloring
Alexandre Terrasa [Sat, 8 Dec 2012 05:19:11 +0000 (00:19 -0500)]
nitg-s: option --use-naive-coloring now affects FT, VT and livegen fabrics coloring

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

11 years agonitg-s/-e: always use coloration for attributes and methods are always
Alexandre Terrasa [Sat, 8 Dec 2012 05:17:44 +0000 (00:17 -0500)]
nitg-s/-e: always use coloration for attributes and methods are always

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

11 years agonitg-s: allocate HashSet[MType] for conflicts_graph_cache
Jean Privat [Sat, 8 Dec 2012 03:05:27 +0000 (22:05 -0500)]
nitg-s: allocate HashSet[MType] for conflicts_graph_cache

A covariant cast error is raised by non-buggy engines when
a MNullableType object is added into a Set[MType] that is
dynamically a HashSet[MClassType].

Instantiate HashSet[MType] instead of HashSet[MClassType] remove
the cast error.

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

11 years agobench: split and specialize "options" benchs
Jean Privat [Fri, 7 Dec 2012 22:18:04 +0000 (17:18 -0500)]
bench: split and specialize "options" benchs

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

11 years agobench: do not crash on die, just flag the failed command
Jean Privat [Fri, 7 Dec 2012 22:13:28 +0000 (17:13 -0500)]
bench: do not crash on die, just flag the failed command

This will make bigtests tests other benchs.

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

11 years agotests: upgrade nitg-s to *.nit
Jean Privat [Fri, 7 Dec 2012 22:10:55 +0000 (17:10 -0500)]
tests: upgrade nitg-s to *.nit

There is still an unknown breakage on nit_args1 :/

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

11 years agonitg: do not compile main during the instantiation
Jean Privat [Sat, 8 Dec 2012 02:05:24 +0000 (21:05 -0500)]
nitg: do not compile main during the instantiation

main requires `init` and `send`, thus it is preferable to
wait that basic structures or whatever are built.

For instance, the new behavior fixes --hardering with nitg.

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

11 years agonitg-s/-e: add option --use-*-perfect-hashing
Alexandre Terrasa [Sat, 8 Dec 2012 00:15:47 +0000 (19:15 -0500)]
nitg-s/-e: add option --use-*-perfect-hashing

Coloration can be replaced by perfect hashing for subtyping tests.

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

11 years agoMerge remote branch 'alexandre/master'
Jean Privat [Fri, 7 Dec 2012 21:15:04 +0000 (16:15 -0500)]
Merge remote branch 'alexandre/master'

11 years agotests: add base_autocast.nit
Jean Privat [Fri, 7 Dec 2012 21:10:40 +0000 (16:10 -0500)]
tests: add base_autocast.nit

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

11 years agonitg: implements implicit casts for unsafe nexpr
Jean Privat [Fri, 7 Dec 2012 20:25:38 +0000 (15:25 -0500)]
nitg: implements implicit casts for unsafe nexpr

add the option --no-check-autocast to disable it.

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

11 years agotests: declare Bool to base_types_nullable_formal_and_virtual
Jean Privat [Fri, 7 Dec 2012 21:09:33 +0000 (16:09 -0500)]
tests: declare Bool to base_types_nullable_formal_and_virtual

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

11 years agotests: fix test_attr_easy.res for the new model.
Jean Privat [Fri, 7 Dec 2012 20:51:43 +0000 (15:51 -0500)]
tests: fix test_attr_easy.res for the new model.

Commit d2992803b added a space in the representation of generic types,
thus changed an error message.

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

11 years agoniti: implements implicit casts for unsafe nexpr
Jean Privat [Fri, 7 Dec 2012 20:03:49 +0000 (15:03 -0500)]
niti: implements implicit casts for unsafe nexpr

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

11 years agotyping: new attribute AExpr::implicit_cast_to
Jean Privat [Fri, 7 Dec 2012 20:01:01 +0000 (15:01 -0500)]
typing: new attribute AExpr::implicit_cast_to

If required, the following implicit cast ".as(XXX)"
Such a cast may by required after evaluating the expression when
a unsafe operation is detected (silently accepted by the Nit language).

The attribute is computed by `check_subtype`

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

11 years agotyping: the return of check_subtype can distinguish safety and unsafely.
Jean Privat [Fri, 7 Dec 2012 19:26:38 +0000 (14:26 -0500)]
typing: the return of check_subtype can distinguish safety and unsafely.

Thus visit_expr_subtype can return the correct type
as if an implicit cast was added.

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

11 years agolib: fix ArrayMapValues::first
Jean Privat [Fri, 7 Dec 2012 06:54:47 +0000 (01:54 -0500)]
lib: fix ArrayMapValues::first

Thanks to the new MType::is_subtype test, bugs like these can be spotted.

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

11 years agomodel: rewrite of MType::is_subtype
Jean Privat [Fri, 7 Dec 2012 06:53:26 +0000 (01:53 -0500)]
model: rewrite of MType::is_subtype

The previous writing was just wrong.
Mainly because the two first `resolve_for` always lost the parameter types.
But the rest of the method was also overly complex and buggy.

Note that the fixed behavior make a test pass because of the
"FIXME workaround" in typing.nit

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

11 years agonitg: refactoring
Alexandre Terrasa [Fri, 7 Dec 2012 05:51:21 +0000 (00:51 -0500)]
nitg: refactoring

No more intrude include import of  coloring
Change blocks from run_global_compiler as new services of GlobalCompiler to nitg for better code reuse in subclasses
* compile header
* compile class names
Rename some functions from generate_ to compile_ for more uniform naming

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

11 years agolib: rewrite Collection::rand without explicit closure
Jean Privat [Thu, 6 Dec 2012 06:06:28 +0000 (01:06 -0500)]
lib: rewrite Collection::rand without explicit closure

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

11 years agotests: test equality on Float
Jean Privat [Thu, 6 Dec 2012 14:59:08 +0000 (09:59 -0500)]
tests: test equality on Float

The point is that some floats are equal even if the bit representation
differs. This helps to illustrate bad implementation of floats.

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

11 years agotests: add base_attr_init_val_raf.nit
Jean Privat [Thu, 6 Dec 2012 00:43:32 +0000 (19:43 -0500)]
tests: add base_attr_init_val_raf.nit

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

11 years agotests: add base_gen_variance.nit
Jean Privat [Thu, 6 Dec 2012 00:26:04 +0000 (19:26 -0500)]
tests: add base_gen_variance.nit

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

11 years agonitg-s/-e: Add option --use-naive-coloring
Alexandre Terrasa [Thu, 6 Dec 2012 21:05:18 +0000 (16:05 -0500)]
nitg-s/-e: Add option --use-naive-coloring

When enabled, this option replace standard coloring by a naive one allowing the compiler to simulate binary matrix type representation.

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

11 years agonitg-e: change empty slots representation in vt tables to avoid C warning in sparse...
Alexandre Terrasa [Thu, 6 Dec 2012 20:28:08 +0000 (15:28 -0500)]
nitg-e: change empty slots representation in vt tables to avoid C warning in sparse tables.

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

11 years agonitg: fix tests/sav/nitg with new options added in nitg-s
Alexandre Terrasa [Thu, 6 Dec 2012 20:27:20 +0000 (15:27 -0500)]
nitg: fix tests/sav/nitg with new options added in nitg-s

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

11 years agonitg-s: add --inline-coloring-numbers option
Alexandre Terrasa [Thu, 6 Dec 2012 06:59:09 +0000 (01:59 -0500)]
nitg-s: add --inline-coloring-numbers option

With this option activated nitg-s use #define to inline coloring numbers.
Without, nitg-s use const.

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

11 years agonitg-s/-e: refactor property coloring for use of #define
Alexandre Terrasa [Thu, 6 Dec 2012 06:27:45 +0000 (01:27 -0500)]
nitg-s/-e: refactor property coloring for use of #define

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

11 years agonitg-s: rename SeparateCompiler:do_global_type_coloring to do_type_coloring
Alexandre Terrasa [Thu, 6 Dec 2012 06:25:40 +0000 (01:25 -0500)]
nitg-s: rename SeparateCompiler:do_global_type_coloring to do_type_coloring

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

11 years agonitg-s/-e: move compiler.header initialisation into init
Alexandre Terrasa [Thu, 6 Dec 2012 06:23:04 +0000 (01:23 -0500)]
nitg-s/-e: move compiler.header initialisation into init

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

11 years agonitg/nitg-s: move MParameterType::c_name and MNullableType::c_name from nitg to nitg-s
Alexandre Terrasa [Thu, 6 Dec 2012 06:21:24 +0000 (01:21 -0500)]
nitg/nitg-s: move MParameterType::c_name and MNullableType::c_name from nitg to nitg-s

Both are only used from nitg-s and subclasses

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

11 years agoMerge remote-tracking branch 'github-privat/master'
Alexandre Terrasa [Thu, 6 Dec 2012 04:34:15 +0000 (23:34 -0500)]
Merge remote-tracking branch 'github-privat/master'

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

11 years agonitg-s/nitg-e: handles nullable virtual type based on non-nullable virtual types.
Alexandre Terrasa [Thu, 6 Dec 2012 03:46:58 +0000 (22:46 -0500)]
nitg-s/nitg-e: handles nullable virtual type based on non-nullable virtual types.

class A
   type T: X
   type U: nullable T
end

U is now correctly considered as a nullable T.

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

11 years agoniti: move base_isa_nullable2 to fixme
Alexandre Terrasa [Thu, 6 Dec 2012 01:46:42 +0000 (20:46 -0500)]
niti: move base_isa_nullable2 to fixme

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

11 years agoniti: do not output object_id (not reliable)
Jean Privat [Thu, 6 Dec 2012 00:32:15 +0000 (19:32 -0500)]
niti: do not output object_id (not reliable)

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

11 years agonitg: check_init_instance use a call CHECK_NEW_XXX
Jean Privat [Wed, 5 Dec 2012 19:06:40 +0000 (14:06 -0500)]
nitg: check_init_instance use a call CHECK_NEW_XXX

This is analogous the the instantiation that call NEW_XXX.
The point is to move global stuff (like the collect of attributes)
to the link-time in separate compilers.

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

11 years agonig: localize init_expr in attributes
Jean Privat [Wed, 5 Dec 2012 16:17:50 +0000 (11:17 -0500)]
nig: localize init_expr in attributes

Add tests to illustrate the behavior.

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

11 years agonitg: factorize Compiler#generate_init_attr
Jean Privat [Wed, 5 Dec 2012 15:07:22 +0000 (10:07 -0500)]
nitg: factorize Compiler#generate_init_attr

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

11 years agonitg: check_init_instance require a type
Jean Privat [Wed, 5 Dec 2012 14:52:43 +0000 (09:52 -0500)]
nitg: check_init_instance require a type

Relying on recv.mcasttype is dangerous.

The check_init_instance should be analogous to the init_instance.

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

11 years agobench: compilation_time: replace nitg.bin by nitg-e
Jean Privat [Wed, 5 Dec 2012 14:21:17 +0000 (09:21 -0500)]
bench: compilation_time: replace nitg.bin by nitg-e

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

11 years agonitg: two equal C types do not imply equal Nit types
Jean Privat [Wed, 5 Dec 2012 04:49:23 +0000 (23:49 -0500)]
nitg: two equal C types do not imply equal Nit types

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

11 years agonitg: add dangerous options to disable runtime tests
Jean Privat [Wed, 5 Dec 2012 04:03:36 +0000 (23:03 -0500)]
nitg: add dangerous options to disable runtime tests

These options can be used to evaluate the runtime cost of some
features of Nit.

run_bench is updated to include these options.

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

11 years agonirg-sep: introduce box_kind to implements the "is" equality test
Jean Privat [Wed, 5 Dec 2012 02:31:50 +0000 (21:31 -0500)]
nirg-sep: introduce box_kind to implements the "is" equality test

Each class is associated with a box_kind value that indicate if it is
a box and what kind of box.

Thus on comparaison, the box_kind can be used to unbox and compare
the real value.

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

11 years agonitg-sep: add option --no-inline-intern
Jean Privat [Wed, 5 Dec 2012 02:55:24 +0000 (21:55 -0500)]
nitg-sep: add option --no-inline-intern

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

11 years agonitg-sep: inline primitive call on intern methods
Jean Privat [Tue, 4 Dec 2012 02:28:19 +0000 (21:28 -0500)]
nitg-sep: inline primitive call on intern methods

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

11 years agonitg-e: fix implementation of class_name_string
Jean Privat [Tue, 4 Dec 2012 14:06:43 +0000 (09:06 -0500)]
nitg-e: fix implementation of class_name_string

see a9435075f8ea304415ca846d69f14b888b3ed37f for details.

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

11 years agonitg: move engine selection to nitg.nit
Jean Privat [Tue, 4 Dec 2012 13:14:41 +0000 (08:14 -0500)]
nitg: move engine selection to nitg.nit

No more ugly hijacking.

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

11 years agonitg-e: better handling of virtual types.
Alexandre Terrasa [Tue, 4 Dec 2012 17:35:28 +0000 (12:35 -0500)]
nitg-e: better handling of virtual types.

VT are now colorized and stored in the class table to be retrieved à type test.

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

11 years agotests: add some tests on virtual types.
Alexandre Terrasa [Tue, 4 Dec 2012 17:27:43 +0000 (12:27 -0500)]
tests: add some tests on virtual types.

tests use recursive vt declarations

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

11 years agotests: add some tests for covariant genericity.
Alexandre Terrasa [Tue, 4 Dec 2012 03:02:50 +0000 (22:02 -0500)]
tests: add some tests for covariant genericity.

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

11 years agomodel: MGenericType::to_s add space between formal types
Alexandre Terrasa [Tue, 4 Dec 2012 01:03:21 +0000 (20:03 -0500)]
model: MGenericType::to_s add space between formal types

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

11 years agonitg-sep: fix calloc_array to use the live generic type of self
Alexandre Terrasa [Mon, 3 Dec 2012 22:27:23 +0000 (17:27 -0500)]
nitg-sep: fix calloc_array to use the live generic type of self

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

11 years agoMerge branch 'master' of https://github.com/privat/nit
Alexandre Terrasa [Mon, 3 Dec 2012 18:45:16 +0000 (13:45 -0500)]
Merge branch 'master' of https://github.com/privat/nit

11 years agonitg-sep: better handling of nullable types
Alexandre Terrasa [Mon, 3 Dec 2012 18:35:33 +0000 (13:35 -0500)]
nitg-sep: better handling of nullable types

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

11 years agonitg-sep: colorize live generic types entries
Alexandre Terrasa [Mon, 3 Dec 2012 17:31:36 +0000 (12:31 -0500)]
nitg-sep: colorize live generic types entries

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

Conflicts:

src/separate_compiler.nit

11 years agobench: add a boostrap test to generate compilers
Jean Privat [Mon, 3 Dec 2012 04:59:28 +0000 (23:59 -0500)]
bench: add a boostrap test to generate compilers

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

11 years agobench: add nitg-e as en engine
Jean Privat [Mon, 3 Dec 2012 04:42:21 +0000 (23:42 -0500)]
bench: add nitg-e as en engine

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

11 years agotests: add nitg-s and nitg-e as specific engines
Jean Privat [Mon, 3 Dec 2012 04:29:03 +0000 (23:29 -0500)]
tests: add nitg-s and nitg-e as specific engines

Notes:
* the base_gen* bug need to be investigated
* make nitg-s only run the base tests

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

11 years agotests: put stderr before stdout
Jean Privat [Mon, 3 Dec 2012 03:52:11 +0000 (22:52 -0500)]
tests: put stderr before stdout

The result files contain in order:

- compiler messages
- error output
- standard output

This improve the compatibility of res with niti since compiler
messages are issued on the error output.

Update the sav/* file to reflect the change.

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

11 years agoniti: write fatal error on stderr
Jean Privat [Mon, 3 Dec 2012 03:52:44 +0000 (22:52 -0500)]
niti: write fatal error on stderr

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

11 years agotests: niti skips test_mem
Jean Privat [Mon, 3 Dec 2012 03:53:07 +0000 (22:53 -0500)]
tests: niti skips test_mem

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

11 years agonitg-e: remove autobox since the inherited one is identical
Jean Privat [Mon, 3 Dec 2012 02:27:41 +0000 (21:27 -0500)]
nitg-e: remove autobox since the inherited one is identical

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

11 years agonitg-sep: BOX_XX does not require a type argument, the class is enough
Jean Privat [Mon, 3 Dec 2012 02:27:06 +0000 (21:27 -0500)]
nitg-sep: BOX_XX does not require a type argument, the class is enough

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

11 years agonitg-sep: partially revert the last commit; do not change nitattribute_t
Jean Privat [Mon, 3 Dec 2012 02:25:01 +0000 (21:25 -0500)]
nitg-sep: partially revert the last commit; do not change nitattribute_t

As usual, it is the little change that could not potentially break things
that break the build.

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

11 years agonitg-sep: improve attribute implementation for primitives
Jean Privat [Sun, 2 Dec 2012 19:55:24 +0000 (14:55 -0500)]
nitg-sep: improve attribute implementation for primitives

primitives are boxed, but the box is reused on write and the unboxed value
is returned on read.

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

11 years agonitg-e: type_test do it easy if the result is statically true
Jean Privat [Sun, 2 Dec 2012 04:35:07 +0000 (23:35 -0500)]
nitg-e: type_test do it easy if the result is statically true

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

11 years agonitg-e: type_test do not box the value.
Jean Privat [Sun, 2 Dec 2012 04:33:54 +0000 (23:33 -0500)]
nitg-e: type_test do not box the value.

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

11 years agonitg-sep: monomorphic_send if the mcasttype is primitive
Jean Privat [Sun, 2 Dec 2012 04:31:36 +0000 (23:31 -0500)]
nitg-sep: monomorphic_send if the mcasttype is primitive

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

11 years agonitg: implements force_garbage_collection
Jean Privat [Sun, 2 Dec 2012 04:30:03 +0000 (23:30 -0500)]
nitg: implements force_garbage_collection

Just call GC_gcollect

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

11 years agonitg: stop displaying debug info on Unimplemented expr
Jean Privat [Sun, 2 Dec 2012 04:29:35 +0000 (23:29 -0500)]
nitg: stop displaying debug info on Unimplemented expr

Runtime still print NOT YET IMPLEMENTED however.

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

11 years agonitg-sep: handles virtual types in typing and init_instance
Alexandre Terrasa [Sat, 1 Dec 2012 22:10:31 +0000 (17:10 -0500)]
nitg-sep: handles virtual types in typing and init_instance

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

11 years agonitg-sep: autobox self before call on self->type
Alexandre Terrasa [Sat, 1 Dec 2012 22:09:31 +0000 (17:09 -0500)]
nitg-sep: autobox self before call on self->type

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

11 years agonitg-sep: fix recursive unanchored type declarations
Alexandre Terrasa [Sat, 1 Dec 2012 20:48:16 +0000 (15:48 -0500)]
nitg-sep: fix recursive unanchored type declarations

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