[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-651-g9cc44a5

Mildred Ki'Lya silkensedai at online.fr
Sat Sep 4 14:58:06 UTC 2010


The following commit has been merged in the master branch:
commit 9cc44a5d4daec5646862697f190a7997de033ac4
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Sat Sep 5 22:52:25 2009 +0200

    CHARACTER.code returns an UINTEGER_8 value instead of an INTEGER_8 value.
    CHARACTER is also an unsigned char C type.

diff --git a/lib/internal/portable/string/character_ref.li b/lib/internal/portable/string/character_ref.li
index 1c93cec..91edd1f 100644
--- a/lib/internal/portable/string/character_ref.li
+++ b/lib/internal/portable/string/character_ref.li
@@ -47,7 +47,7 @@ Section Public
     item < other.item
   );
 
-  - code:INTEGER_8 <-
+  - code:UINTEGER_8 <-
   // ASCII code of Current
   (
     item.code
diff --git a/lib/standard/number/integer/integer.li b/lib/standard/number/integer/integer.li
index 38be838..aef466f 100644
--- a/lib/standard/number/integer/integer.li
+++ b/lib/standard/number/integer/integer.li
@@ -410,7 +410,7 @@ Section Public
     -? {in_range 0 to 9};
   ]
   (
-    (Self.to_integer_8 + '0'.code).to_character
+    (Self.to_uinteger_8 + '0'.code).to_character
   )
   [
     +? {"0123456789".has Result};
@@ -429,7 +429,7 @@ Section Public
     (Self <= 9).if {
       result := digit;
     } else {
-      result := ('A'.code + (Self - 10).to_integer_8).to_character;
+      result := ('A'.code + (Self - 10).to_uinteger_8).to_character;
     };
     result
   )
@@ -437,7 +437,7 @@ Section Public
     +? {"0123456789ABCDEF".has Result};
   ];
 
-  - to_character:CHARACTER <- to_integer_8.to_character;
+  - to_character:CHARACTER <- to_uinteger_8.to_character;
   // Return the coresponding ASCII character.
 
   - to_octal:SELF <-
diff --git a/lib/standard/number/integer/uinteger.li b/lib/standard/number/integer/uinteger.li
index 116653d..ba785ac 100644
--- a/lib/standard/number/integer/uinteger.li
+++ b/lib/standard/number/integer/uinteger.li
@@ -356,7 +356,7 @@ Section Public
     -? {in_range 0 to 9};
   ]
   (
-    (Self.to_integer_8 + '0'.code).to_character
+    (Self.to_uinteger_8 + '0'.code).to_character
   )
   [
     +? {"0123456789".has Result};
@@ -375,7 +375,7 @@ Section Public
     (Self <= 9).if {
       result := digit;
     } else {
-      result := ('A'.code + (Self - 10).to_integer_8).to_character;
+      result := ('A'.code + (Self - 10).to_uinteger_8).to_character;
     };
     result
   )
@@ -383,7 +383,7 @@ Section Public
     +? {"0123456789ABCDEF".has Result};
   ];
 
-  - to_character:CHARACTER <- to_integer_8.to_character;
+  - to_character:CHARACTER <- to_uinteger_8.to_character;
   // Return the coresponding ASCII character.
 
   - to_octal:SELF <-
diff --git a/lib/standard/string/character.li b/lib/standard/string/character.li
index 1517504..b82a187 100644
--- a/lib/standard/string/character.li
+++ b/lib/standard/string/character.li
@@ -22,13 +22,13 @@ Section Header
 
   + name    := Expanded CHARACTER;
 
-  - export  := INTEGER_8, CHAR_UNICODE;
+  - export  := UINTEGER_8, CHAR_UNICODE;
 
   - copyright   := "2003-2005 Jérome Boutet, 2003-2007 Benoit Sonntag";
 
   - comment := "Static Character library (self is mapping on `char' C).";
 
-  - type    := `char`;
+  - type    := `unsigned char`;
   - default := '\0';
 
 Section Insert
@@ -53,23 +53,23 @@ Section Public
   // Sign-extended conversion.
   ( + result:INTEGER;
     result:=code.to_integer;
-    ? {result.in_range (INTEGER_8.minimum) to (INTEGER_8.maximum)};
+    ? {result.in_range (UINTEGER_8.minimum) to (UINTEGER_8.maximum)};
     result
   );
 
-  - code:INTEGER_8 <-
+  - code:UINTEGER_8 <-
   // ASCII code of Current.
   // No Sign-extended conversion.
-  ( + result:INTEGER_8;
-    result:=to_integer_8;
+  ( + result:UINTEGER_8;
+    result:=to_uinteger_8;
     //? {result.in_range minimum to maximum};
     result
   );
 
   - to_integer_8:INTEGER_8 <- CONVERT(CHARACTER,INTEGER_8).on Self;
-  // Auto-cast.
 
   - to_uinteger_8:UINTEGER_8 <- CONVERT(CHARACTER,UINTEGER_8).on Self;
+  // Auto-cast.
 
   //
   // Print.
diff --git a/src/code_life/instr.li b/src/code_life/instr.li
index 760cf8f..ff192fa 100644
--- a/src/code_life/instr.li
+++ b/src/code_life/instr.li
@@ -36,7 +36,7 @@ Section Public
 
   - is_invariant:BOOLEAN <- FALSE;
   // TODO: Documentation
-  // For expressions, it seems they are invariant if they are constant, like 
+  // For expressions, it seems they are invariant if they are constant, like
   // sizeof or binary operators on two invariant expressions.
   // For instructions, it is redefined in LIST, SWITCH and WRITE
 

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list