[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-388-g554ac8b

Benoit Sonntag sonntag at icps.u-strasbg.fr
Mon Aug 10 04:28:47 UTC 2009


The following commit has been merged in the master branch:
commit 554ac8beac17fcc264479841d7e1799699601419
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date:   Mon Aug 10 06:28:43 2009 +0200

    stack overflow debug mode progress...

diff --git a/src2/code_life/list.li b/src2/code_life/list.li
index 087c0fd..286f528 100644
--- a/src2/code_life/list.li
+++ b/src2/code_life/list.li
@@ -334,6 +334,12 @@ Section Private
 	loc := tab.item j;	
         loc.is_result.if_false {
           local_counter := local_counter + 1;
+          /*
+          ((loc.ensure_count != 0) && {! loc.is_result}).if {
+            loc.intern_name.print;
+            warning_error (loc.position,"LIST.add_local Error!");
+          };
+          */
           (((buf.count + loc.intern_name.count - cur) > 70) || {t != loc.type}).if {
             // New line
             (t != NULL).if {
diff --git a/src2/code_life/read_local.li b/src2/code_life/read_local.li
index b8aba23..d2851fd 100644
--- a/src2/code_life/read_local.li
+++ b/src2/code_life/read_local.li
@@ -80,11 +80,22 @@ Section Public
   //
   // Genere
   //
-  
+    
   - genere buffer:STRING <-
   ( + tb:PROFIL_BLOCK;
+
     (variable.ensure_count = -1).if {
       buffer.add_last '*';
+    } else {
+      (variable.style = '+').if {        
+        variable.set_ensure_count (variable.ensure_count - 1);
+        (variable.ensure_count < 0).if {
+          variable.intern_name.print; '\n'.print;
+          warning_error (variable.position,"READ_LOCAL.genere : Bug local !\n");
+          variable.set_ensure_count 0;
+          buffer.append "/* BUG READ_LOCAL !*/";
+        };        
+      };
     };
     buffer.append (variable.intern_name);     
     //
diff --git a/src2/code_life/switch.li b/src2/code_life/switch.li
index dd1cc8a..c2ede6f 100644
--- a/src2/code_life/switch.li
+++ b/src2/code_life/switch.li
@@ -254,6 +254,8 @@ Section Public
     + typ_first:TYPE;
     + typ_id:TYPE_ID;
     + wrt:WRITE;
+    + is_genered:BOOLEAN;
+    + rd:READ;
     
     (
       (list.first.id = TYPE_NULL) && 
@@ -265,84 +267,80 @@ Section Public
       }
     ).if {
       list.remove_first;
-    };
-    /*
-    i := list.upper;
-    {i >= list.lower}.while_do {
-      (list.item i.code.is_empty).if {
-        list.remove i;
-      };
-      i := i - 1;
-    };      
-    */
-    //
-    //(list.is_empty).if_false {
-      typ_first := list.first.id;
-      typ_id ?= typ_first;    
-      ((list.count <= 2) || {typ_first = TYPE_NULL}).if {
-        buffer.append "if (";
-        //                        
-        ((expr.static_type.raw.is_block) && {typ_first = TYPE_NULL}).if {
-          expr.genere buffer;	
-          buffer.append ".__id==0";
+    };        
+    typ_first := list.first.id;
+    typ_id ?= typ_first;    
+    ((list.count <= 2) || {typ_first = TYPE_NULL}).if {
+      buffer.append "if (";
+      //                        
+      ((expr.static_type.raw.is_block) && {typ_first = TYPE_NULL}).if {        
+        expr.genere buffer;
+        is_genered := TRUE;
+        buffer.append ".__id==0";
+      } else {        
+        typ_first.put_access_id expr in buffer;      
+        is_genered := TRUE;
+        (expr.static_type.raw != type_boolean).if {
+          buffer.append "==";
+          typ_first.put_id buffer;	
         } else {
-          typ_first.put_access_id expr in buffer;      
-          (expr.static_type.raw != type_boolean).if {
-            buffer.append "==";
-            typ_first.put_id buffer;	
-          } else {
-            ? {typ_first.name = ALIAS_STR.prototype_true};
-          };
+          ? {typ_first.name = ALIAS_STR.prototype_true};
         };
-        buffer.append ") ";
-        //
-        list.first.genere buffer;             
-        first_case := 1;
-        //
-        (list.count = 2).if {
-          lst := list.second.code;                    
-          (! list.second.code.is_empty).if {
-            buffer.append " else ";
-            
-            buffer.append "/* ";
-            buffer.append (list.second.id.name);
-            buffer.append " */ ";
-            
-            list.second.genere buffer;          
-          };
-          first_case := 2;
-        }.elseif {list.count > 2} then {
-          buffer.append " else {\n";
-          indent.append "  ";
-          buffer.append indent;          
+      };
+      buffer.append ") ";
+      //
+      list.first.genere buffer;             
+      first_case := 1;
+      //
+      (list.count = 2).if {
+        lst := list.second.code;                    
+        (! list.second.code.is_empty).if {
+          buffer.append " else ";          
+          buffer.append "/* ";
+          buffer.append (list.second.id.name);
+          buffer.append " */ ";          
+          list.second.genere buffer;          
         };
+        first_case := 2;
+      }.elseif {list.count > 2} then {
+        buffer.append " else {\n";
+        indent.append "  ";
+        buffer.append indent;          
       };
-      (first_case <= list.upper).if {
-        polymorphic_counter := polymorphic_counter + 1;            
-        buffer.append "switch (";      
-        list.item first_case.id.put_access_id expr in buffer;
-        buffer.append ") {\n";
-        (first_case).to (list.upper) do { j:INTEGER;
-          (! list.item j.code.is_empty).if {
-            buffer.append indent; 
-            buffer.append "case ";
-            list.item j.id.put_id buffer;
-            buffer.append ": ";          
-            list.item j.genere buffer;        
-            buffer.add_last ' ';	
-            buffer.append "break;\n";
-          };
-        };	      
+    };
+    (first_case <= list.upper).if {
+      polymorphic_counter := polymorphic_counter + 1;            
+      buffer.append "switch (";      
+      (is_genered).if {
+        rd ?= expr;
+        (rd = NULL).if {
+          crash_with_message "SWITCH.genere ";
+        } else {
+          rd.variable.set_ensure_count (rd.variable.ensure_count + 1);
+        };
+      };
+      list.item first_case.id.put_access_id expr in buffer;
+      buffer.append ") {\n";
+      (first_case).to (list.upper) do { j:INTEGER;
+        (! list.item j.code.is_empty).if {
+          buffer.append indent; 
+          buffer.append "case ";
+          list.item j.id.put_id buffer;
+          buffer.append ": ";          
+          list.item j.genere buffer;        
+          buffer.add_last ' ';	
+          buffer.append "break;\n";
+        };
+      };	      
+      buffer.append indent;
+      buffer.add_last '}';
+      (first_case != 0).if {
+        buffer.add_last '\n';
+        indent.remove_last 2;    
         buffer.append indent;
         buffer.add_last '}';
-        (first_case != 0).if {
-          buffer.add_last '\n';
-          indent.remove_last 2;    
-          buffer.append indent;
-          buffer.add_last '}';
-        };
       };
-    //};
+    };
   );
   
   //
diff --git a/src2/tools/position.li b/src2/tools/position.li
index 94e2b9e..97998c7 100644
--- a/src2/tools/position.li
+++ b/src2/tools/position.li
@@ -79,7 +79,9 @@ Section Public
     is_verbose.if {
       msg_err.print;
     };
-    (type_error != warning).if {    
+    (type_error = warning).if {    
+      nb_warning := nb_warning + 1;
+    } else {
       die_with_code exit_failure_code;
     };
   );
diff --git a/src2/variable/variable.li b/src2/variable/variable.li
index c13397d..268bf94 100644
--- a/src2/variable/variable.li
+++ b/src2/variable/variable.li
@@ -210,26 +210,11 @@ Section Public
     };         
     
     e.set_create;
-    /*
-    (intern_name == "Self__GB").if {
-      "Creat :".print;
-      e.debug_display;
-      warning_error (e.position,"LA");
-    };
-    */
-    
     e
   );
     
   - unwrite e:WRITE <-
   ( + idx:INTEGER;
-    /*
-    (intern_name == "Self__GB").if {
-      e.debug_display;
-      warning_error (e.position,"LA");
-    };
-    */
-    
     (! e.is_create).if {
       crash;
     };
@@ -306,16 +291,6 @@ Section Public
         
     result := new_read position with r;   
     ensure_count := ensure_count + 1;    
-    /*
-    (intern_name == "Result__ID").if {
-      "VARIABLE create :".print;
-      result.debug_display;      
-      (result.object_id = 6).if {
-       // crash;
-      };
-    };
-    */
-    
     result
   );
   //[ ? {ensure_count := Old ensure_count + 1}; ];

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list