nit.git
14 years agolib: Split collections into readable and writable
Jean Privat [Wed, 10 Jun 2009 13:29:20 +0000 (09:29 -0400)]
lib: Split collections into readable and writable

Map ->
  MapRead (r)
  Map (rw)
IndexedCollection ->
  IndexedCollectionRead (r)
  IndexedCollection (rw)
AbstractArray ->
  AbstractArrayRead (r)
  AbstractArray (rw)
String ->
  String (ro)
  Buffer (rw)

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

14 years agonew c_src
Jean Privat [Wed, 10 Jun 2009 13:04:55 +0000 (09:04 -0400)]
new c_src

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

15 years agoCompile superstrings with an array.to_s
Jean Privat [Thu, 26 Feb 2009 15:10:11 +0000 (10:10 -0500)]
Compile superstrings with an array.to_s

15 years agoMove primitive method selection.
Jean Privat [Thu, 26 Feb 2009 11:31:52 +0000 (06:31 -0500)]
Move primitive method selection.

Move primitive method selection from compiling_methods to typing.

15 years agoRemove unused macro symbols.
Jean Privat [Thu, 26 Feb 2009 10:21:10 +0000 (05:21 -0500)]
Remove unused macro symbols.

15 years agoSome renaming and commenting for TableElts.
Jean Privat [Fri, 13 Feb 2009 20:01:44 +0000 (15:01 -0500)]
Some renaming and commenting for TableElts.

15 years agoGroup attributes and methods by local class in the module tables.
Jean Privat [Fri, 13 Feb 2009 19:13:07 +0000 (14:13 -0500)]
Group attributes and methods by local class in the module tables.

15 years agoRemove now useless variables and attributes in compile_global
Jean Privat [Fri, 13 Feb 2009 18:01:48 +0000 (13:01 -0500)]
Remove now useless variables and attributes in compile_global

15 years agoNew method compile_macros in TableElts.
Jean Privat [Fri, 13 Feb 2009 16:57:28 +0000 (11:57 -0500)]
New method compile_macros in TableElts.

This simplify the way some C macros are generated.

15 years agoRemove -attr-sim option (was broken) and related classes.
Jean Privat [Fri, 13 Feb 2009 16:48:05 +0000 (11:48 -0500)]
Remove -attr-sim option (was broken) and related classes.

15 years agoDo not use CALL macro directly.
Jean Privat [Thu, 12 Feb 2009 02:02:58 +0000 (21:02 -0500)]
Do not use CALL macro directly.

Instead generate specific call macro for methods and use them.

15 years agoFix a Makefile dependence for rebootstrap mercurial_tip v0.2
Jean Privat [Fri, 6 Feb 2009 16:00:12 +0000 (11:00 -0500)]
Fix a Makefile dependence for rebootstrap
Allow a safe new bootstrap from a old Nit bootstrap.

15 years agoUpdate gitignore
Jean Privat [Fri, 6 Feb 2009 15:48:46 +0000 (10:48 -0500)]
Update gitignore

15 years agoUpdate c_src to handle default closures.
Jean Privat [Fri, 6 Feb 2009 15:45:26 +0000 (10:45 -0500)]
Update c_src to handle default closures.

15 years agoFinish syntax analysis for default closure.
Jean Privat [Fri, 6 Feb 2009 15:26:27 +0000 (10:26 -0500)]
Finish syntax analysis for default closure.

15 years agoDistinguish no bloc vs. empty bloc
Jean Privat [Fri, 6 Feb 2009 15:24:30 +0000 (10:24 -0500)]
Distinguish no bloc vs. empty bloc
On empty bloc, a empty ABlocExpr is given instead of null.

15 years agoNew test suite for default blocs.
Jean Privat [Fri, 6 Feb 2009 15:11:20 +0000 (10:11 -0500)]
New test suite for default blocs.

15 years agoGeneralize base_block in control_flow.
Jean Privat [Fri, 6 Feb 2009 14:42:38 +0000 (09:42 -0500)]
Generalize base_block in control_flow.

15 years agoGeneralize compilation of parameters.
Jean Privat [Fri, 6 Feb 2009 14:39:37 +0000 (09:39 -0500)]
Generalize compilation of parameters.
Add a compile_parameters in PSignature that do the stuff.

15 years agoBasic typing and compilation for default closures.
Jean Privat [Fri, 30 Jan 2009 09:15:00 +0000 (04:15 -0500)]
Basic typing and compilation for default closures.

15 years agoEnable default closure in syntax
Jean Privat [Fri, 30 Jan 2009 08:36:38 +0000 (03:36 -0500)]
Enable default closure in syntax

15 years agoRemove useless _abstract atribute
Jean Privat [Wed, 28 Jan 2009 02:27:10 +0000 (21:27 -0500)]
Remove useless _abstract atribute

15 years agoUpdate c_src.
Jean Privat [Tue, 27 Jan 2009 19:51:55 +0000 (14:51 -0500)]
Update c_src.

15 years agoTwo new tests related to the BUGS file. No sav yet.
Jean Privat [Tue, 27 Jan 2009 19:41:42 +0000 (14:41 -0500)]
Two new tests related to the BUGS file. No sav yet.

15 years agoFill BUGS file.
Jean Privat [Tue, 27 Jan 2009 19:37:05 +0000 (14:37 -0500)]
Fill BUGS file.

15 years agoFinalizer for closures.
Jean Privat [Sat, 24 Jan 2009 04:50:43 +0000 (23:50 -0500)]
Finalizer for closures.
Closure calls can accept a closure defintion performed if the closure breaks or returns.

15 years agoNew function process_closures.
Jean Privat [Sat, 24 Jan 2009 01:58:24 +0000 (20:58 -0500)]
New function process_closures.
Extract closure processing from ASendExpr into a new function in AAbsSendExpr.
Add process_closures in do_typing.
Update tests since error message has changed.

15 years agoFix MMSignature::not_for_self
Jean Privat [Sat, 24 Jan 2009 01:55:06 +0000 (20:55 -0500)]
Fix MMSignature::not_for_self
3 bugs:
 * return value not correctly set
 * closure badly managed
 * vararg forgoten is any

15 years agoAdd break closure.
Jean Privat [Thu, 22 Jan 2009 20:59:26 +0000 (15:59 -0500)]
Add break closure.
Break closure must break. They are great for error management.

15 years agoNew class MMClosure
Jean Privat [Thu, 22 Jan 2009 19:35:12 +0000 (14:35 -0500)]
New class MMClosure
Closure in signature are not only signature.
This commit prepare to add more metainfo like 'break' closure or optionality.

15 years agoUpdate results for closure tests
Jean Privat [Thu, 22 Jan 2009 14:46:24 +0000 (09:46 -0500)]
Update results for closure tests

15 years agoCompile closure.
Jean Privat [Thu, 22 Jan 2009 14:43:38 +0000 (09:43 -0500)]
Compile closure.

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