[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-438-g0c30e14

sonntag (none) sonntag at isaac.
Sun Aug 23 21:40:41 UTC 2009


The following commit has been merged in the master branch:
commit 0c30e14f54e5aeff9284631c40dbb85f7550a2a2
Author: sonntag <sonntag at isaac.(none)>
Date:   Sun Aug 23 23:40:33 2009 +0200

    is_prime PA a voir

diff --git a/lib/number/integer.li b/lib/number/integer.li
index 2433fe7..d514c22 100644
--- a/lib/number/integer.li
+++ b/lib/number/integer.li
@@ -313,13 +313,14 @@ Section Public
     + result : BOOLEAN;
     diviseur := 5;
     sqrt_s := sqrt;
+    result := TRUE;
     ((Self % 2 = 0) || {Self % 3 = 0}).if_false {
-     1.to sqrt_s until {(Self % diviseur) = 0} do { cpt : INTEGER;
-       diviseur := diviseur + 2 + (((cpt-1) & 1) << 1);
-     };
-     result := result  && {!((Self % diviseur) = 0)};
-  };
-  result
+      1.to sqrt_s until {(Self % diviseur) = 0} do { cpt : INTEGER;
+        diviseur := diviseur + 2 + (((cpt-1) & 1) << 1);
+      };
+      result := result  && {!((Self % diviseur) = 0)};
+    };
+    result
   );
 
 
diff --git a/src/code_life/read_slot.li b/src/code_life/read_slot.li
index 5e93272..29b781a 100644
--- a/src/code_life/read_slot.li
+++ b/src/code_life/read_slot.li
@@ -115,6 +115,7 @@ Section Public
     
     (is_java).if {
       receiver.genere buffer;
+      not_yet_implemented;
       buffer.add_last '.';
       buffer.append (variable.intern_name);
     } else {    
@@ -131,10 +132,8 @@ Section Public
         tf := receiver.static_type;    
         ((tf.is_strict) || {tf.is_expanded_ref}).if {
           receiver.genere buffer;
-          buffer.append "->";
         }.elseif {tf.is_expanded} then {      
           receiver.genere buffer;
-          buffer.add_last '.';          
         } else {          
           buffer.append "((";
           t := slot.receiver_type;
@@ -143,9 +142,16 @@ Section Public
           t.put_reference_star_declaration buffer;	
           buffer.add_last ')';
           receiver.genere buffer;
-          buffer.append ")->";
+          buffer.add_last ')';          
+        };
+        ((tf.raw.alias_slot = NULL) || {! TYPE.is_alias_struct}).if {
+          ((tf.is_expanded) && {! tf.is_expanded_ref} && {! tf.is_strict}).if {
+            buffer.add_last '.';
+          } else {
+            buffer.append "->";
+          };        
+          buffer.append (variable.intern_name);
         };
-        buffer.append (variable.intern_name);
       };    
     };
   );
diff --git a/src/type/type.li b/src/type/type.li
index 3627a16..7560fa5 100644
--- a/src/type/type.li
+++ b/src/type/type.li
@@ -36,7 +36,9 @@ Section Inherit
   
   - parent_parameter_to_type:Expanded PARAMETER_TO_TYPE;
   
-Section TYPE
+Section TYPE, READ_SLOT
+  
+  - is_alias_struct:BOOLEAN := FALSE;
   
   - dico_type:HASHED_DICTIONARY(TYPE,STRING_CONSTANT) := 
   HASHED_DICTIONARY(TYPE,STRING_CONSTANT).create;
@@ -661,7 +663,7 @@ Section Public
               output_decl.append "super();\n";
             };
             output_decl.append "  };\n};\n";  
-          } else {            
+          }.elseif {(alias_slot = NULL) && {is_alias_struct}} then {                        
             output_decl.append "struct ";
             output_decl.append intern_name;
             output_decl.append "_struct {\n";
@@ -728,13 +730,17 @@ Section Public
         output_decl.append type_c;
       } else {
         output_decl.append "struct ";
-        output_decl.append intern_name;
+        (alias_slot != NULL).if {
+          output_decl.append (alias_type.intern_name);
+        } else {
+          output_decl.append intern_name;
+        };        
         output_decl.append "_struct";        
       };
       output_decl.append " __";
       output_decl.append intern_name;	  
       output_decl.add_last ';';      
-      ((type_c = NULL) && {alias_slot != NULL}).if {
+      ((type_c = NULL) && {alias_slot != NULL} && {is_alias_struct}).if {
         output_decl.append " // ALIAS with ";
         output_decl.append (alias_type.intern_name);
       };

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list