[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-549-ga4a91ff

Benoit Sonntag sonntag at icps.u-strasbg.fr
Tue Nov 24 19:52:09 UTC 2009


The following commit has been merged in the master branch:
commit a4a91ff79275064a109b6434b793445b4ae2d3e2
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date:   Tue Nov 24 20:52:01 2009 +0100

    Clauss off

diff --git a/lib/internal/portable/collection/collection.li b/lib/internal/portable/collection/collection.li
index 75baec7..abdbdc7 100644
--- a/lib/internal/portable/collection/collection.li
+++ b/lib/internal/portable/collection/collection.li
@@ -533,7 +533,7 @@ Section Public
   // Looking and comparison:
   //
   
-  - Self:SELF '=='  Right 60 other:OBJECT :BOOLEAN <-
+  - Self:SELF '=='  Right 60 other:E :BOOLEAN <-
   // Do both collections have the same `lower', `upper', and
   // items?
   // The basic `=' is used for comparison of items.
diff --git a/lib/internal/portable/number/numeric.li b/lib/internal/portable/number/numeric.li
index dd607bd..887450e 100644
--- a/lib/internal/portable/number/numeric.li
+++ b/lib/internal/portable/number/numeric.li
@@ -116,14 +116,14 @@ Section Public
   - Self:SELF '<='  Right 60 other:SELF :BOOLEAN <- ! (Self > other);
   
   - Self:SELF '>='  Right 60 other:SELF :BOOLEAN <- (Self > other) | (Self = other);
-/*  
+  
   - Self:SELF '=='  Right 60 other:E :BOOLEAN <- 
   ( + my_other:SELF;
     
     my_other := other;
     Self = my_other
   );
-  */
+  
   //
   // Switch case :
   //
diff --git a/lib/standard/collection/fast_array.li b/lib/standard/collection/fast_array.li
index 0fed681..ed7ac33 100644
--- a/lib/standard/collection/fast_array.li
+++ b/lib/standard/collection/fast_array.li
@@ -421,7 +421,7 @@ Section Public
     }; 
   ); 
     
-  - Self:SELF '=='  Right 60 other:OBJECT :BOOLEAN <-
+  - Self:SELF '=='  Right 60 other:E :BOOLEAN <-
   ( + result:BOOLEAN;
     + same:SELF;
      
diff --git a/lib/standard/kernel/object.li b/lib/standard/kernel/object.li
index c4d0285..353cc06 100644
--- a/lib/standard/kernel/object.li
+++ b/lib/standard/kernel/object.li
@@ -109,7 +109,7 @@ Section Public
   // Common Function.
   //
   
-  - Self:SELF '=='  Right 60 other:OBJECT :BOOLEAN <- ( deferred; FALSE);
+  //- Self:SELF '=='  Right 60 other:OBJECT :BOOLEAN <- ( deferred; FALSE);
   
   //- Self:SELF '=='  Right 60 other:E :BOOLEAN <- ( deferred; FALSE);
   
diff --git a/lib/standard/property/comparable.li b/lib/standard/property/comparable.li
index 02f34dd..d4df7bc 100644
--- a/lib/standard/property/comparable.li
+++ b/lib/standard/property/comparable.li
@@ -34,7 +34,7 @@ Section Inherit
   
 Section Public
   
-  - Self:SELF '=='  Right 60 other:OBJECT :BOOLEAN <- 
+  - Self:SELF '=='  Right 60 other:E :BOOLEAN <- 
   ( + result:BOOLEAN;
     + same:SELF;
     same ?= other;
diff --git a/lib/standard/string/abstract_string.li b/lib/standard/string/abstract_string.li
index 412e7a0..db371af 100644
--- a/lib/standard/string/abstract_string.li
+++ b/lib/standard/string/abstract_string.li
@@ -248,7 +248,7 @@ Section Public
     result
   );
   
-  - Self:SELF '==' Left 40 other:OBJECT :BOOLEAN <-
+  - Self:SELF '==' Left 40 other:E :BOOLEAN <-
   // Has Current the same text as `other' ?
   ( + same:ABSTRACT_STRING;
     same ?= other;
diff --git a/src/any.li b/src/any.li
index e39fd67..30c6cfc 100644
--- a/src/any.li
+++ b/src/any.li
@@ -118,7 +118,7 @@ Section Public
   - new_depend_pass <-
   (    
     modify_count := modify_count + 1;
-    //(pass_count > 50).if {
+    //(pass_count > 60).if {
     //  crash;
     //};
   );
diff --git a/src/code_life/switch.li b/src/code_life/switch.li
index 05373e5..e8d1a45 100644
--- a/src/code_life/switch.li
+++ b/src/code_life/switch.li
@@ -63,6 +63,7 @@ Section Public
   //
   
   - create n:NODE with e:EXPR size s:INTEGER :SELF <-
+  [ -? {n.position != 0}; ]
   ( + result:SELF;
     
     result := clone;
@@ -71,7 +72,7 @@ Section Public
   );  
   
   
-  - make n:NODE with e:EXPR size s:INTEGER <-
+  - make n:NODE with e:EXPR size s:INTEGER <-  
   ( + first:CASE;
     
     position := n.position;
@@ -170,7 +171,36 @@ Section Public
       };
       string_tmp.print;
       '\n'.print;
-      syntax_error (position,"*****SWITCH BUG********");
+      /*
+      string_tmp.clear;
+      profil_current.display string_tmp;
+      string_tmp.print;
+      
+      
+      ( + wrt2:WRITE;
+        + rd:READ;
+        + var:VARIABLE;
+        
+        rd ?= expr;
+        var := rd.variable;
+        wrt2 := var.require_first;
+        rd ?= wrt2.value;
+        var := rd.variable;
+        
+        wrt2 := var.require_first;
+        wrt2.debug_display;
+        "==============\n".print;
+        (var.require_list.lower).to (var.require_list.upper) do { i:INTEGER;
+          "==============\n".print;          
+          i.print; '\n'.print;
+          wrt2 := var.require_list.item i;
+          wrt2.debug_display;
+          (i = 2).if {
+            warning_error (wrt2.position,"ICI");
+          };
+        };
+      );*/
+      syntax_error (expr.position,"*****SWITCH BUG********");
     };
     
     //    
diff --git a/src/dispatcher/dta_block.li b/src/dispatcher/dta_block.li
index e859c0b..18de214 100644
--- a/src/dispatcher/dta_block.li
+++ b/src/dispatcher/dta_block.li
@@ -52,6 +52,7 @@ Section Public
   );
   
   - make mod:TYPE_BLOCK with larg:FAST_ARRAY(EXPR) <-
+  [ -? {mod.position != 0}; ]
   (    
     (profil_current = NULL).if {
       context := context_main;
@@ -59,6 +60,7 @@ Section Public
       context := profil_current.context;
     };    
     model         := mod;
+    position      := mod.position;
     argument_list := larg;
     result_expr   := mod.get_expr_for (mod.position);    
   );
diff --git a/src/dispatcher/dta_cast.li b/src/dispatcher/dta_cast.li
index 8b90866..e8108f8 100644
--- a/src/dispatcher/dta_cast.li
+++ b/src/dispatcher/dta_cast.li
@@ -41,6 +41,7 @@ Section Public
   //
   
   - create p:POSITION type t:TYPE_FULL :SELF <-
+  [ -? {p != 0}; ]
   ( + result:SELF;
     
     result := clone;
@@ -50,6 +51,7 @@ Section Public
   
   - make p:POSITION type t:TYPE_FULL <-
   (
+    position := p;
     result_expr := t.get_temporary_expr p;
     (profil_current = NULL).if {
       context := context_main;
diff --git a/src/dispatcher/dta_rd.li b/src/dispatcher/dta_rd.li
index 205093f..42e00b2 100644
--- a/src/dispatcher/dta_rd.li
+++ b/src/dispatcher/dta_rd.li
@@ -58,6 +58,7 @@ Section Public
   //
   
   - create p:POSITION call sl:SLOT self arg:EXPR intern flag:BOOLEAN :SELF <-
+  [ -? {p != 0}; ]
   ( + result:SELF;
     
     result := clone;
diff --git a/src/dispatcher/dta_rd_args.li b/src/dispatcher/dta_rd_args.li
index 06450d1..d218cdc 100644
--- a/src/dispatcher/dta_rd_args.li
+++ b/src/dispatcher/dta_rd_args.li
@@ -62,6 +62,7 @@ Section Public
   //
   
   - create p:POSITION call sl:SLOT with args:FAST_ARRAY(EXPR) intern flag:BOOLEAN :SELF <-
+  [ -? {p != 0}; ]
   ( + result:SELF;
     
     result := clone;
diff --git a/src/dispatcher/dta_wr_code.li b/src/dispatcher/dta_wr_code.li
index 87faa7e..1d638eb 100644
--- a/src/dispatcher/dta_wr_code.li
+++ b/src/dispatcher/dta_wr_code.li
@@ -43,6 +43,7 @@ Section Public
   //
   
   - create p:POSITION slot sl:SLOT self arg:EXPR code v:ITM_CODE :SELF <-
+  [ -? {p != 0}; ]
   ( + result:SELF;
     
     result := clone;
diff --git a/src/dispatcher/dta_wr_value.li b/src/dispatcher/dta_wr_value.li
index f59e9fd..7a0e9d9 100644
--- a/src/dispatcher/dta_wr_value.li
+++ b/src/dispatcher/dta_wr_value.li
@@ -45,6 +45,7 @@ Section Public
   //
   
   - create p:POSITION slot sl:SLOT self arg:EXPR value v:EXPR :SELF <-
+  [ -? {p != 0}; ]
   ( + result:SELF;
     
     result := clone;
diff --git a/src/dispatcher/node.li b/src/dispatcher/node.li
index f6e334e..f1928c1 100644
--- a/src/dispatcher/node.li
+++ b/src/dispatcher/node.li
@@ -145,10 +145,11 @@ Section Public
   // Extern creation cast.
   //
   
-  - new_cast p:POSITION type typ:TYPE_FULL with val:EXPR :NODE <-
+  - new_cast p:POSITION type typ:TYPE_FULL with val:EXPR :NODE <-  
+  [ -? {p != 0}; ]
   ( + dta:DTA_CAST;
     + result:NODE_TYPE;
-    
+        
     dta := DTA_CAST.create p type typ;
     result := NODE_TYPE.create val with dta;
     //
@@ -213,7 +214,10 @@ Section Public
   
 Section Public  
   
-  - position:POSITION <- data.position;
+  - position:POSITION <- 
+  ( 
+    data.position
+  );
   
   + data:DTA;
   
diff --git a/src/dispatcher/node_type.li b/src/dispatcher/node_type.li
index 15c86e7..91ae3e1 100644
--- a/src/dispatcher/node_type.li
+++ b/src/dispatcher/node_type.li
@@ -44,6 +44,7 @@ Section Public
     
   - create e:EXPR with d:DTA :SELF <-
   // Create with back-link.
+  [ -? {d.position != 0}; ]
   ( + result:SELF;
     
     result := clone;
diff --git a/src/item/itm_write.li b/src/item/itm_write.li
index 307e3ea..5648718 100644
--- a/src/item/itm_write.li
+++ b/src/item/itm_write.li
@@ -53,6 +53,7 @@ Section Public
   //
   
   - create p:POSITION assign n:ITM_CODE with v:ITM_CODE :SELF <-
+  [ -? {p != 0}; ]
   ( + result:SELF;
     result := clone;
     result.make p assign n with v;
diff --git a/src/lisaac.li b/src/lisaac.li
index 348c7f8..0cc9fbf 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -281,9 +281,8 @@ Section Private
     {k <= path_file.lower}.until_do {
       (path_file.item k = path_file.item (k-1)).if {
         path_file.remove k;
-      } else {
-        k := k - 1;
       };
+      k := k - 1;
     };
     
     (is_path_list).if {
diff --git a/src/make.lip b/src/make.lip
index 7ff8d91..77c9339 100644
--- a/src/make.lip
+++ b/src/make.lip
@@ -64,10 +64,6 @@ Section Private
   - front_end <-
   (    
     general_front_end;        
-    
-    
-    src_path; // BSB: A virer !!!
-    
     ((input_file = "") | (input_file = "lisaac")).if {    
       compiler_path;
       (is_valid).if {
diff --git a/src/profil.li b/src/profil.li
index caa6710..fe6625d 100644
--- a/src/profil.li
+++ b/src/profil.li
@@ -42,6 +42,7 @@ Section PROFIL_LIST
   );
   
 Section Public
+  
   - propagation_external <-
   (
     (external_present).if_false {
@@ -355,15 +356,19 @@ Section Public
   
   - execute_recursive <-
   ( + old_list_current:LIST;    
+    + old_profil_current:PROFIL;
     
     (stat = -1).if {
       count_intern_call := count_intern_call + 1;            
       (count_intern_call = 1).if {	  	  
-	old_list_current   := list_current;
-	//
+        old_list_current   := list_current;
+        old_profil_current := profil_current;
+        //
+        profil_current := Self;
 	execute 3;
 	//	
-	list_current   := old_list_current;
+        list_current   := old_list_current;
+        profil_current := old_profil_current;
 	? {code != NULL};      
 	(count_intern_call = 1).if {	  
           stat := 0;
@@ -656,6 +661,7 @@ Section Private
     (argument_list.lower).to (argument_list.upper) do { j:INTEGER;
       v := argument_list.item j;
       (v != NULL).if {
+        v.type.display buffer;
 	v.display_type buffer;
 	buffer.add_last ',';
       };
diff --git a/src/profil_slot.li b/src/profil_slot.li
index 13be90e..9ce0231 100644
--- a/src/profil_slot.li
+++ b/src/profil_slot.li
@@ -65,12 +65,12 @@ Section Public
     (p.name = ALIAS_STR.prototype_self).if {
       // For Self.
       result := type_self;                
-    } else {
+    } else {      
       // For Genericity.    
       //result := type_self.raw.parameter_to_type p;
       result := slot_code.receiver_type.parameter_to_type p;
       (result = NULL).if {            
-        // For Type parametric.
+        // For Type parametric.        
         idx := slot_code.get_index_argument_type p;
         (idx != - 1).if {
           result := arg_type_tmp.item idx.static_type;
@@ -117,16 +117,15 @@ Section Public
       list_current.add_last (PUSH.create (slot_code.position) context context first TRUE);
     };
     //
-    code := list_current;
-    arg_type_tmp := call_lst;
+    code := list_current;    
     //
     // Arguments.    
+    arg_type_tmp := call_lst;
     item_lst := s.argument_list;    
     argument_list := FAST_ARRAY(LOCAL).create_with_capacity (s.argument_count); 
     (item_lst.lower).to (item_lst.upper) do { j:INTEGER;
       item_lst.item j.to_run_in argument_list for Self;
     };
-    
     ((s.id_section.is_external) && {argument_list.count > 1}).if {
       (argument_list.lower+1).to (argument_list.upper) do { j:INTEGER;      
 	loc := argument_list.item j;
diff --git a/src/tools/types_tmp.li b/src/tools/types_tmp.li
index b0b9fbe..9cc1db3 100644
--- a/src/tools/types_tmp.li
+++ b/src/tools/types_tmp.li
@@ -117,9 +117,14 @@ Section Public
     result
   );
   
-  - free <-
+  - clear <-
   (
     upper := -1;
+  );
+  
+  - free <-
+  (
+    clear;
     free_list.add_last Self;
   );
   
diff --git a/src/variable/slot_code.li b/src/variable/slot_code.li
index 014eb6b..2c2fbd3 100644
--- a/src/variable/slot_code.li
+++ b/src/variable/slot_code.li
@@ -62,8 +62,9 @@ Section Public
     + typ:TYPE_FULL;
     + typ_block:PROFIL_BLOCK;
     + typ_list:TYPES_TMP;
-    + pro_list:FAST_ARRAY(PROFIL_SLOT);    
+    + pro_list:FAST_ARRAY(PROFIL_SLOT);
     + is_new:BOOLEAN;
+    + lst_typ:TYPES_TMP;
         
     // Block Detect.
     j := args.lower;
@@ -109,36 +110,27 @@ Section Public
       };
     } else {	    
       // Select classic Profil (no block).
-     /* 
-      (name == "__infix_equal_equal").if {
-        "SELF : ".print;
-        type_self.raw.print; 
-        ' '.print;
-        args.second.static_type.raw.print;
-        (type_self.raw.name == "STRING_CONSTANT").if {
-          crash;
-        };
-        '\n'.print;
-      };
-      */
       j := profil.lower;      
       {(j <= profil.upper) && {result = NULL}}.while_do {
 	pro := profil.item j;					
 	((pro.type_self = NULL) || {pro.type_self == type_self}).if {
-	  result := pro;
-	  i := args.lower + 1;
-	  {(i <= args.upper) && {result != NULL}}.while_do {
-	    typ := args.item i.static_type;
+          result := pro;
+          lst_typ := TYPES_TMP.new;            
+          i := args.lower + 1;          
+          {(i <= args.upper) && {result != NULL}}.while_do {
+            lst_typ.clear;
+            args.item i.get_type lst_typ;
 	    loc := pro.argument_list.item i;	    	    
 	    (
-	      (loc != NULL) && 
-	      {(typ.is_expanded) || {loc.type.is_expanded       }} && 
-	      {typ !== loc.type} && {loc.type.raw != type_boolean}
-	    ).if {
+	      (loc != NULL) && 	     
+	      {! (lst_typ ~= loc.type_list)} && 
+              {loc.type.raw != type_boolean}
+            ).if {                            
 	      result := NULL;	      	      	      
 	    };
 	    i := i + 1;    
-	  };
+          };
+          lst_typ.free;
 	};
 	j := j + 1;
       };
@@ -149,6 +141,20 @@ Section Public
 	  semantic_error (position,"Polymorphic External slot is not possible.");
 	};
 	is_new := TRUE;
+      } else {
+        /*
+        (name == "__infix_equal_equal").if {          
+          (type_self.raw.name == "STRING_CONSTANT").if {
+            string_tmp.clear;
+            typ := args.item 1.static_type;
+            typ.display string_tmp;
+            string_tmp.add_last '=';
+            typ := pro.argument_list.item 1.type;
+            typ.display string_tmp;
+            string_tmp.add_last '\n';
+            string_tmp.print;
+          };
+        };*/
       };
     };
     (is_new).if {            

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list