nit.git
15 years agoNew test suite for closures
Jean Privat [Wed, 21 Jan 2009 16:00:36 +0000 (11:00 -0500)]
New test suite for closures

15 years agoType and check 'break' return values.
Jean Privat [Wed, 21 Jan 2009 15:28:31 +0000 (10:28 -0500)]
Type and check 'break' return values.
A small inference is done in case of multiple breaks.

15 years agoType and check 'continue' return value.
Jean Privat [Tue, 20 Jan 2009 23:30:27 +0000 (18:30 -0500)]
Type and check 'continue' return value.
Also detects closure with a missing continue.

15 years agoTyping of closures
Jean Privat [Tue, 20 Jan 2009 23:01:42 +0000 (18:01 -0500)]
Typing of closures

15 years agoUpdate Nit grammar to add closures.
Jean Privat [Tue, 20 Jan 2009 20:33:17 +0000 (15:33 -0500)]
Update Nit grammar to add closures.

15 years agoAdd default values for some primitive type attributes.
Jean Privat [Tue, 27 Jan 2009 18:07:03 +0000 (13:07 -0500)]
Add default values for some primitive type attributes.

15 years agoFix opts: forgot to assign the default value.
Jean Privat [Tue, 27 Jan 2009 18:01:18 +0000 (13:01 -0500)]
Fix opts: forgot to assign the default value.

15 years agoNo more default value for local variables.
Jean Privat [Tue, 27 Jan 2009 13:25:36 +0000 (08:25 -0500)]
No more default value for local variables.
Control flow requires that a variable is assigned before used.

15 years agoRemove a old exception for constructors.
Jean Privat [Tue, 27 Jan 2009 13:15:04 +0000 (08:15 -0500)]
Remove a old exception for constructors.

15 years agoNew tests base_init_auto and error_init_auto.
Jean Privat [Mon, 26 Jan 2009 22:19:47 +0000 (17:19 -0500)]
New tests base_init_auto and error_init_auto.

15 years agoFix base_init_linext tests.
Jean Privat [Mon, 26 Jan 2009 21:41:51 +0000 (16:41 -0500)]
Fix base_init_linext tests.

15 years agoDo not compile unaccessible constructors.
Jean Privat [Mon, 26 Jan 2009 21:31:08 +0000 (16:31 -0500)]
Do not compile unaccessible constructors.

15 years agoUpdate get_default_constructor_for and AConcreteInitPropdef
Jean Privat [Mon, 26 Jan 2009 21:17:45 +0000 (16:17 -0500)]
Update get_default_constructor_for and AConcreteInitPropdef
* Use is_init_for
* No super-constructor found is now an error
* super_init_calls skips mixin classes

15 years agoPromote mixin concept to the abstractmetamodel module.
Jean Privat [Mon, 26 Jan 2009 20:03:25 +0000 (15:03 -0500)]
Promote mixin concept to the abstractmetamodel module.
Add is_mixin and mixing_of in MMGlobalClass.
Add is_init_for in MMGlobalProperty.
Update process_default_constructors in mmbuilder.

15 years agoFix some broken constructors.
Jean Privat [Mon, 26 Jan 2009 19:46:15 +0000 (14:46 -0500)]
Fix some broken constructors.
Unautomatize attributes in MMAncestor class.
Explicitly call super in MMTypeFormal.

15 years agoSuppress C warnings related to NEW_ functions
Jean Privat [Sun, 25 Jan 2009 05:09:51 +0000 (00:09 -0500)]
Suppress C warnings related to NEW_ functions
Declare real NEW_{class}_{meth} function prototypes in sep.h files
Remove useless NEW_{meth} functions prototypes from sep.h files

15 years agoShow gcc warnings.
Jean Privat [Sun, 25 Jan 2009 05:03:24 +0000 (00:03 -0500)]
Show gcc warnings.
Also remove some trivial warnings.

15 years agoMake 'self' a standard parameter (ParamVariable)
Jean Privat [Tue, 20 Jan 2009 19:59:50 +0000 (14:59 -0500)]
Make 'self' a standard parameter (ParamVariable)
This simplify the implementation and allows isa to work on self.
A new test, base_isa_cast_self, is also added to check cast on self.

15 years agoMove local variable declarations in a structure.
Jean Privat [Tue, 20 Jan 2009 19:25:18 +0000 (14:25 -0500)]
Move local variable declarations in a structure.
All local variables are created in an array declared in the top of the C functions.

15 years agoSplit CompilerVisitor into 3 classes.
Jean Privat [Tue, 20 Jan 2009 18:56:51 +0000 (13:56 -0500)]
Split CompilerVisitor into 3 classes.
CFunctionContext is about the C function currently written
NitMethodContext is about the Nit method currenlty compiled

15 years agoDot not try to work after parsing if --only-parse is given.
Jean Privat [Tue, 20 Jan 2009 18:21:17 +0000 (13:21 -0500)]
Dot not try to work after parsing if --only-parse is given.

15 years agoPrevent statements to be used as expressions.
Jean Privat [Tue, 20 Jan 2009 18:10:46 +0000 (13:10 -0500)]
Prevent statements to be used as expressions.
Add two method check_expr and check_conform_expr that check if an
PExpr is a real expression (not a statement) and its conformity.

Update existing tests to match the possibly updated error message.
Add a new test, base_meth_call, to detect some 'stmt as expr' errors.

15 years agoSimplify control flow and update tests.
Jean Privat [Tue, 20 Jan 2009 16:55:09 +0000 (11:55 -0500)]
Simplify control flow and update tests.
attr _has_return is not needed since _unreash can do the job.
Also improve the error message if a return is missing.
Tests results are updated to reflect the new error message.

15 years agoRemove specific flow analysis for params and forvardecls
Jean Privat [Mon, 19 Jan 2009 22:26:17 +0000 (17:26 -0500)]
Remove specific flow analysis for params and forvardecls
Instead, consider that only variable declared with var need to be set.

15 years agoFix tests.sh to not forget some alternatives.
Jean Privat [Mon, 19 Jan 2009 22:12:15 +0000 (17:12 -0500)]
Fix tests.sh to not forget some alternatives.
Negative-only alternatives are now included.

15 years agoExtract get_signature from process_signature.
Jean Privat [Sun, 28 Dec 2008 22:26:08 +0000 (17:26 -0500)]
Extract get_signature from process_signature.
Rationale: blocs will require processing of a known signature.

15 years agoNew SignatureBuilder class.
Jean Privat [Sun, 28 Dec 2008 22:01:58 +0000 (17:01 -0500)]
New SignatureBuilder class.
Extract signature buildding from PropertyVerifierVisitor to the
new class SignatureBuilder.
Rationnale is that with blocs, signatures will be somewhat nested.

15 years agoSpecialize Variable class.
Jean Privat [Mon, 19 Jan 2009 20:22:42 +0000 (15:22 -0500)]
Specialize Variable class.
Create 3 subclasses: VarVariable, ParamVariable and AutoVariable

15 years agoGenerate parser prod subclasses with null assigned attributes.
Jean Privat [Sun, 28 Dec 2008 16:49:33 +0000 (11:49 -0500)]
Generate parser prod subclasses with null assigned attributes.

15 years agoRename methods named 'with'.
Jean Privat [Sun, 28 Dec 2008 16:28:43 +0000 (11:28 -0500)]
Rename methods named 'with'.
Blocs will use the reserved 'with' keyword.

15 years agoAdd "file_delete" method in String and NativeString.
Jean-Sebastien Gelinas [Fri, 24 Oct 2008 01:14:12 +0000 (21:14 -0400)]
Add "file_delete" method in String and NativeString.
Implemented native function to delete a file.

15 years agoUpdate SCM ignore rules.
Jean Privat [Sun, 28 Dec 2008 00:06:56 +0000 (19:06 -0500)]
Update SCM ignore rules.

15 years agoUpdate c_src with new default constructor rules.
Jean Privat [Sun, 28 Dec 2008 00:00:32 +0000 (19:00 -0500)]
Update c_src with new default constructor rules.

15 years agoMore picky 'super' in constructors.
Jean Privat [Sat, 27 Dec 2008 18:54:55 +0000 (13:54 -0500)]
More picky 'super' in constructors.
Now super do not chose any constructor without parameter, but only those named 'init'

15 years agoAutomatic constructors.
Jean Privat [Sat, 27 Dec 2008 18:43:26 +0000 (13:43 -0500)]
Automatic constructors.
Automatic constructors are implicit anonymous init that collects unassigned
attributes in their signatures.

15 years agoMethods without PNodes.
Jean Privat [Sat, 27 Dec 2008 14:56:33 +0000 (09:56 -0500)]
Methods without PNodes.
Unlike explicit methods, implicit methods are not associated with a PNode.
These changes bring up the infrastructure for such inplicit methods.

15 years agoNew tests for inherited constructors.
Jean Privat [Sat, 27 Dec 2008 20:15:40 +0000 (15:15 -0500)]
New tests for inherited constructors.

15 years agoInheritance of constructors.
Jean Privat [Sat, 27 Dec 2008 16:23:39 +0000 (11:23 -0500)]
Inheritance of constructors.
A class without constructors can inherit those of its superclasses.
These classes are called "Mixin" since their subclasses do not have to care about their initialisation.

The inherited constructors are all that belong to the most specific non-mixin superclass.

15 years agoCustomize constructor call.
Jean Privat [Sat, 27 Dec 2008 05:28:50 +0000 (00:28 -0500)]
Customize constructor call.
Now that properties are not adapted during inheritance:
 * compile_constructor_call takes the static type of the instantiated class
 * constructors are customized according to the instantiated class

15 years agoDo not crash if a constructor is not found.
Jean Privat [Sat, 27 Dec 2008 14:05:05 +0000 (09:05 -0500)]
Do not crash if a constructor is not found.

15 years agoConform constructors to the strict 'redef' rule.
Jean Privat [Sat, 27 Dec 2008 19:02:13 +0000 (14:02 -0500)]
Conform constructors to the strict 'redef' rule.
For some old reasons, 'redef' in front of a new constructor was ignored.
Now the standard behavior is the rule for constructors.

15 years agoPrepare Nit code for inherited and automatic constructors.
Jean Privat [Sat, 27 Dec 2008 20:12:19 +0000 (15:12 -0500)]
Prepare Nit code for inherited and automatic constructors.
All components are impacted (stdlib, compiler and tests).
Changes concern:
 * attribute default values
 * constructor namies
 * class kind
 * redef keyword

15 years agoUpdate c_src. Enable one gcc pass bootstrap.
Jean Privat [Fri, 26 Dec 2008 03:29:00 +0000 (22:29 -0500)]
Update c_src. Enable one gcc pass bootstrap.

15 years agoOnly one gcc pass for initial bootstrap
Jean Privat [Fri, 26 Dec 2008 03:27:01 +0000 (22:27 -0500)]
Only one gcc pass for initial bootstrap

15 years agoMake that option -p is appenned to comdir instead of each file.
Jean Privat [Fri, 26 Dec 2008 03:12:20 +0000 (22:12 -0500)]
Make that option -p is appenned to comdir instead of each file.

15 years agoAdd option --compdir to specify the compilation directory.
Jean Privat [Fri, 26 Dec 2008 02:40:03 +0000 (21:40 -0500)]
Add option --compdir to specify the compilation directory.
By the way, rename the badly named 'base_dir' attrbute to 'compdir'.

15 years agoMake gccx consider filepaths independently.
Jean Privat [Thu, 25 Dec 2008 19:33:48 +0000 (14:33 -0500)]
Make gccx consider filepaths independently.

15 years agoMake that generated files are path independent.
Jean Privat [Thu, 25 Dec 2008 16:55:29 +0000 (11:55 -0500)]
Make that generated files are path independent.

15 years agoUpdate c_src
Jean Privat [Thu, 25 Dec 2008 11:34:17 +0000 (06:34 -0500)]
Update c_src

15 years agoUpdate tests
Jean Privat [Thu, 25 Dec 2008 10:39:40 +0000 (05:39 -0500)]
Update tests
Fix count in tests.sh
Update various .nit and .sav

test add rterror_check.sav ####

15 years agoMove test *.sav files to a sav/ subdirectory.
Jean Privat [Wed, 24 Dec 2008 04:05:00 +0000 (23:05 -0500)]
Move test *.sav files to a sav/ subdirectory.

15 years agoDo not abort when comparing signatures, just return false
Jean Privat [Thu, 25 Dec 2008 10:56:42 +0000 (05:56 -0500)]
Do not abort when comparing signatures, just return false

15 years agoFix nitdoc since MMConcreteProperty is removed.
Jean Privat [Thu, 25 Dec 2008 02:27:48 +0000 (21:27 -0500)]
Fix nitdoc since MMConcreteProperty is removed.

15 years agoMove property selectors from types to local classes
Jean Privat [Wed, 24 Dec 2008 00:30:28 +0000 (19:30 -0500)]
Move property selectors from types to local classes

15 years agoRemove the now useless MMConcreteProperty class
Jean Privat [Tue, 23 Dec 2008 22:48:34 +0000 (17:48 -0500)]
Remove the now useless MMConcreteProperty class

15 years agoSimplify local property inheritance.
Jean Privat [Tue, 23 Dec 2008 22:23:52 +0000 (17:23 -0500)]
Simplify local property inheritance.
Without implicit properties, local property inheritance is easier.

15 years agostart removing implicit properties
Jean Privat [Tue, 23 Dec 2008 20:29:06 +0000 (15:29 -0500)]
start removing implicit properties

15 years agoRemove some remaining PRM references
Jean Privat [Wed, 26 Nov 2008 22:46:47 +0000 (17:46 -0500)]
Remove some remaining PRM references

15 years agoFix nitdoc
Jean Privat [Wed, 26 Nov 2008 22:39:18 +0000 (17:39 -0500)]
Fix nitdoc

15 years agoremove putenv, setenv and unsetenv
Jean Privat [Wed, 26 Nov 2008 21:04:52 +0000 (16:04 -0500)]
remove putenv, setenv and unsetenv

15 years agoRemove non portable -C option in makefiles
Jean Privat [Wed, 26 Nov 2008 21:04:01 +0000 (16:04 -0500)]
Remove non portable -C option in makefiles

15 years agoFix 64 bits: use long int in class tables
Jean Privat [Wed, 26 Nov 2008 15:25:44 +0000 (10:25 -0500)]
Fix 64 bits: use long int in class tables

15 years agoAutomatically enable Bohem's GC if available.
Jean Privat [Wed, 10 Sep 2008 22:10:16 +0000 (18:10 -0400)]
Automatically enable Bohem's GC if available.
On Debian based system, just run
# aptitude install libgc-dev

Remark: it is only a trade off until we have our own GC.

15 years agoUnset variable control flow
Jean Privat [Tue, 25 Nov 2008 18:59:40 +0000 (13:59 -0500)]
Unset variable control flow

15 years agoPrepare unset variable control flow
Jean Privat [Tue, 25 Nov 2008 18:58:56 +0000 (13:58 -0500)]
Prepare unset variable control flow

15 years agoAs keyword (for casts)
Jean Privat [Thu, 20 Nov 2008 22:51:57 +0000 (17:51 -0500)]
As keyword (for casts)

15 years agoFix bug: select incompatible default constructor
Jean Privat [Fri, 14 Nov 2008 21:51:02 +0000 (16:51 -0500)]
Fix bug: select incompatible default constructor

15 years agoPrepare infrastructure for default constructor
Jean Privat [Fri, 14 Nov 2008 10:10:41 +0000 (05:10 -0500)]
Prepare infrastructure for default constructor

15 years agoRemove class MMSrcLocalProperty. Use MMConcreteProperty instead
Jean Privat [Fri, 14 Nov 2008 10:04:41 +0000 (05:04 -0500)]
Remove class MMSrcLocalProperty. Use MMConcreteProperty instead

15 years agoDot not consider Sys::init as an entry point
Jean Privat [Fri, 14 Nov 2008 09:56:30 +0000 (04:56 -0500)]
Dot not consider Sys::init as an entry point

15 years agoPrepare default constructors
Jean Privat [Fri, 14 Nov 2008 09:39:52 +0000 (04:39 -0500)]
Prepare default constructors

15 years agonew devel tool: mkcsrc
Jean Privat [Thu, 13 Nov 2008 22:40:57 +0000 (17:40 -0500)]
new devel tool: mkcsrc
mkcsrc is used to generate a new c_src/ directory from a nitc executable
generated in src/

15 years agoNew c_src (with reduced string pool and simplified building)
Jean Privat [Thu, 13 Nov 2008 22:40:14 +0000 (17:40 -0500)]
New c_src (with reduced string pool and simplified building)

15 years agoFactorize common strings in generated C.
Jean Privat [Thu, 13 Nov 2008 21:29:17 +0000 (16:29 -0500)]
Factorize common strings in generated C.
It reduces the constant pool size in the executable.

15 years agoAdd a first comment line for files generated by nitc.
Jean Privat [Wed, 10 Sep 2008 21:24:40 +0000 (17:24 -0400)]
Add a first comment line for files generated by nitc.

15 years agoAdded tag v0.1 for changeset 6979f59d3d1c
Jean Privat [Wed, 9 Jul 2008 19:55:53 +0000 (15:55 -0400)]
Added tag v0.1 for changeset 6979f59d3d1c

15 years agoFirst NIT release and new clean mercurial repository v0.1
Jean Privat [Wed, 9 Jul 2008 19:55:44 +0000 (15:55 -0400)]
First NIT release and new clean mercurial repository