[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-451-g41f15ce

Mildred Ki'Lya silkensedai at online.fr
Mon Aug 24 20:46:09 UTC 2009


The following commit has been merged in the master branch:
commit 41f15ce94e5ca11d0fcc0d289d0c83ff6ca2252e
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Mon Aug 24 22:45:14 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/base/character.li b/lib/base/character.li
index 0d0c532..6137d2c 100644
--- a/lib/base/character.li
+++ b/lib/base/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
@@ -55,27 +55,27 @@ 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_char_unicode:CHAR_UNICODE <- CHAR_UNICODE.force_conversion Self;
   // Auto-cast.
   
   - to_uinteger_8:UINTEGER_8 <- CONVERT(CHARACTER,UINTEGER_8).on Self;
-  
+  // Auto-cast.  
   //
   // Print.
   //
diff --git a/lib/number/integer.li b/lib/number/integer.li
index d514c22..cfcef6f 100644
--- a/lib/number/integer.li
+++ b/lib/number/integer.li
@@ -398,7 +398,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};
@@ -417,7 +417,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
   )
@@ -425,7 +425,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 <-

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list