Jean Privat [Wed, 3 Jun 2009 17:22:24 +0000 (13:22 -0400)]
compile: C comments for each compiled stmt/expr
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 3 Jun 2009 13:47:35 +0000 (09:47 -0400)]
compile: Fix inlined return in closure
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 10 Jun 2009 14:00:28 +0000 (10:00 -0400)]
compile: Fix closure break marker resetting
Set the break marker each time the block is called, not at the top of the function.
Side-effect: this fix also remove a gcc warning.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Apr 2009 02:31:35 +0000 (22:31 -0400)]
compile: Extract closure code from ASendExpr::compile_expr
The new function is MMMethod::compile_call_and_closures.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 10 Jun 2009 13:54:50 +0000 (09:54 -0400)]
tests: tests.sh returns 1 if some tests fails
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 3 Jun 2009 16:31:50 +0000 (12:31 -0400)]
tests: Add errlist
Failed tests names are stored in a errlist.
The errlist can then be used to feed next tests.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 3 Jun 2009 15:32:01 +0000 (11:32 -0400)]
tests: remove broken HTML output
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 3 Jun 2009 16:37:22 +0000 (12:37 -0400)]
parser: Do not crash if last_loken is unset
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 20 May 2009 19:27:52 +0000 (15:27 -0400)]
parser: Add 'fun' and 'var'-as-attr keyword
New keywords are equivalent with the old 'meth' ant 'attr'.
The existing source Nit code is not adapted yet and keeps 'meth' and 'attr'.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 20 May 2009 19:09:33 +0000 (15:09 -0400)]
parser: Remove ~nobra on type production
Why was it here?
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 20 May 2009 18:54:39 +0000 (14:54 -0400)]
parser: Remove tl_propdef* parser rules
Instead use parametrized propdef rules with ~toplevel
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Apr 2009 22:20:59 +0000 (18:20 -0400)]
ast: Merge classes AForExpr and AForVardeclExpr
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 3 Jun 2009 16:55:34 +0000 (12:55 -0400)]
parser: Script for extended sablecc3 syntax
Move hacks from the Makefile to a new shell script (prescc.sh).
Propose a cleaner syntax with ~ and ! characters.
See doc in prescc.sh for details.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 24 Mar 2009 14:23:04 +0000 (10:23 -0400)]
syntax: Do not inherit signatures with closures
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 24 Mar 2009 14:06:18 +0000 (10:06 -0400)]
syntax: Systematic signature conformance checks
These tests will catch errors that are not yet specifically handeled by working on the syntax tree.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2009 20:54:26 +0000 (15:54 -0500)]
compile: Implicit 'once' for literal strings
Signed-off-by: Jean Privat <jean@pryen.org>
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>
Jean Privat [Wed, 10 Jun 2009 13:04:55 +0000 (09:04 -0400)]
new c_src
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2009 15:10:11 +0000 (10:10 -0500)]
Compile superstrings with an array.to_s
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.
Jean Privat [Thu, 26 Feb 2009 10:21:10 +0000 (05:21 -0500)]
Remove unused macro symbols.
Jean Privat [Fri, 13 Feb 2009 20:01:44 +0000 (15:01 -0500)]
Some renaming and commenting for TableElts.
Jean Privat [Fri, 13 Feb 2009 19:13:07 +0000 (14:13 -0500)]
Group attributes and methods by local class in the module tables.
Jean Privat [Fri, 13 Feb 2009 18:01:48 +0000 (13:01 -0500)]
Remove now useless variables and attributes in compile_global
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.
Jean Privat [Fri, 13 Feb 2009 16:48:05 +0000 (11:48 -0500)]
Remove -attr-sim option (was broken) and related classes.
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.
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.
Jean Privat [Fri, 6 Feb 2009 15:48:46 +0000 (10:48 -0500)]
Update gitignore
Jean Privat [Fri, 6 Feb 2009 15:45:26 +0000 (10:45 -0500)]
Update c_src to handle default closures.
Jean Privat [Fri, 6 Feb 2009 15:26:27 +0000 (10:26 -0500)]
Finish syntax analysis for default closure.
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.
Jean Privat [Fri, 6 Feb 2009 15:11:20 +0000 (10:11 -0500)]
New test suite for default blocs.
Jean Privat [Fri, 6 Feb 2009 14:42:38 +0000 (09:42 -0500)]
Generalize base_block in control_flow.
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.
Jean Privat [Fri, 30 Jan 2009 09:15:00 +0000 (04:15 -0500)]
Basic typing and compilation for default closures.
Jean Privat [Fri, 30 Jan 2009 08:36:38 +0000 (03:36 -0500)]
Enable default closure in syntax
Jean Privat [Wed, 28 Jan 2009 02:27:10 +0000 (21:27 -0500)]
Remove useless _abstract atribute
Jean Privat [Tue, 27 Jan 2009 19:51:55 +0000 (14:51 -0500)]
Update c_src.
Jean Privat [Tue, 27 Jan 2009 19:41:42 +0000 (14:41 -0500)]
Two new tests related to the BUGS file. No sav yet.
Jean Privat [Tue, 27 Jan 2009 19:37:05 +0000 (14:37 -0500)]
Fill BUGS file.
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.
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.
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
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.
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.
Jean Privat [Thu, 22 Jan 2009 14:46:24 +0000 (09:46 -0500)]
Update results for closure tests
Jean Privat [Thu, 22 Jan 2009 14:43:38 +0000 (09:43 -0500)]
Compile closure.
Jean Privat [Wed, 21 Jan 2009 16:00:36 +0000 (11:00 -0500)]
New test suite for closures
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.
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.
Jean Privat [Tue, 20 Jan 2009 23:01:42 +0000 (18:01 -0500)]
Typing of closures
Jean Privat [Tue, 20 Jan 2009 20:33:17 +0000 (15:33 -0500)]
Update Nit grammar to add closures.
Jean Privat [Tue, 27 Jan 2009 18:07:03 +0000 (13:07 -0500)]
Add default values for some primitive type attributes.
Jean Privat [Tue, 27 Jan 2009 18:01:18 +0000 (13:01 -0500)]
Fix opts: forgot to assign the default value.
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.
Jean Privat [Tue, 27 Jan 2009 13:15:04 +0000 (08:15 -0500)]
Remove a old exception for constructors.
Jean Privat [Mon, 26 Jan 2009 22:19:47 +0000 (17:19 -0500)]
New tests base_init_auto and error_init_auto.
Jean Privat [Mon, 26 Jan 2009 21:41:51 +0000 (16:41 -0500)]
Fix base_init_linext tests.
Jean Privat [Mon, 26 Jan 2009 21:31:08 +0000 (16:31 -0500)]
Do not compile unaccessible constructors.
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
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.
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.
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
Jean Privat [Sun, 25 Jan 2009 05:03:24 +0000 (00:03 -0500)]
Show gcc warnings.
Also remove some trivial warnings.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
Jean Privat [Mon, 19 Jan 2009 20:22:42 +0000 (15:22 -0500)]
Specialize Variable class.
Create 3 subclasses: VarVariable, ParamVariable and AutoVariable
Jean Privat [Sun, 28 Dec 2008 16:49:33 +0000 (11:49 -0500)]
Generate parser prod subclasses with null assigned attributes.
Jean Privat [Sun, 28 Dec 2008 16:28:43 +0000 (11:28 -0500)]
Rename methods named 'with'.
Blocs will use the reserved 'with' keyword.
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.
Jean Privat [Sun, 28 Dec 2008 00:06:56 +0000 (19:06 -0500)]
Update SCM ignore rules.
Jean Privat [Sun, 28 Dec 2008 00:00:32 +0000 (19:00 -0500)]
Update c_src with new default constructor rules.
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'
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.
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.
Jean Privat [Sat, 27 Dec 2008 20:15:40 +0000 (15:15 -0500)]
New tests for inherited 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.
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
Jean Privat [Sat, 27 Dec 2008 14:05:05 +0000 (09:05 -0500)]
Do not crash if a constructor is not found.
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.
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
Jean Privat [Fri, 26 Dec 2008 03:29:00 +0000 (22:29 -0500)]
Update c_src. Enable one gcc pass bootstrap.
Jean Privat [Fri, 26 Dec 2008 03:27:01 +0000 (22:27 -0500)]
Only one gcc pass for initial bootstrap
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.
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'.
Jean Privat [Thu, 25 Dec 2008 19:33:48 +0000 (14:33 -0500)]
Make gccx consider filepaths independently.
Jean Privat [Thu, 25 Dec 2008 16:55:29 +0000 (11:55 -0500)]
Make that generated files are path independent.
Jean Privat [Thu, 25 Dec 2008 11:34:17 +0000 (06:34 -0500)]
Update c_src
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 ####
Jean Privat [Wed, 24 Dec 2008 04:05:00 +0000 (23:05 -0500)]
Move test *.sav files to a sav/ subdirectory.
Jean Privat [Thu, 25 Dec 2008 10:56:42 +0000 (05:56 -0500)]
Do not abort when comparing signatures, just return false