[SCM] Lisaac compiler branch, mildred-string-cst, updated. lisaac-0.12-614-g5e0ea86
Mildred Ki'Lya
silkensedai at online.fr
Fri Nov 13 11:58:19 UTC 2009
The following commit has been merged in the mildred-string-cst branch:
commit 954f1a1836c690ca7e5b366b6506b951f6d20484
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/standard/number/integer/uinteger.li b/lib/standard/number/integer/uinteger.li
index 7607a83..8964eae 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 2a9d8e3..037be3f 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.
--
Lisaac compiler
More information about the Lisaac-commits
mailing list