[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-606-g4554e79

Mildred Ki'Lya silkensedai at online.fr
Mon Mar 1 01:30:55 UTC 2010


The following commit has been merged in the master branch:
commit 06762912cdc8c137c5074c79f04cb21c2d21d229
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Sat Oct 24 19:07:42 2009 +0200

    Updated FILE_INPUT_STREAM

diff --git a/lib/internal/os_support/unix/file_system/file_unix.li b/lib/internal/os_support/unix/file_system/file_unix.li
index 6ebe4d8..7e6be7d 100644
--- a/lib/internal/os_support/unix/file_system/file_unix.li
+++ b/lib/internal/os_support/unix/file_system/file_unix.li
@@ -85,7 +85,7 @@ Section Public
   - open_read_only:BOOLEAN <-
   ( + pa:NATIVE_ARRAY(CHARACTER);    
     pa := path.to_external;
-    stream := `fopen((char*)@path_pointer,"rb")`:(POINTER); 
+    stream := `fopen((char*)@pa,"rb")`:(POINTER);
     stream != NULL
   ); 
   
diff --git a/lib/internal/portable/io/file_input_stream.li b/lib/internal/portable/io/file_input_stream.li
index 957941f..fcecc05 100644
--- a/lib/internal/portable/io/file_input_stream.li
+++ b/lib/internal/portable/io/file_input_stream.li
@@ -52,6 +52,7 @@ Section Public
   - make std_file:FILE <-
   (
     file := std_file;
+    tmp  := FAST_ARRAY(CHARACTER).create 1;
     is_connected := (file != NULL);
   );
 
@@ -64,7 +65,7 @@ Section Public
 
 Section Private
 
-  - tmp :NATIVE_ARRAY(UINTEGER_8) := NATIVE_ARRAY(UINTEGER_8).create 1;
+  + tmp :FAST_ARRAY(CHARACTER);
 
   + real_end_of_input :BOOLEAN;
 
@@ -72,21 +73,18 @@ Section Public
 
   - read_character <-
   // Return last character from stream
-  ( + result:INTEGER;
-    
+  ( + result   :INTEGER;
+
     push_back_flag.if {
       push_back_flag := FALSE;
-    } else {  
-      result := file.physical_read tmp size 1;
+    } else {
+      tmp.clear;
+      result := file.read tmp size 1;
       (result = 0).if {
         // nothing was read
         real_end_of_input := TRUE;
       } else {
-        last_character := tmp.first.to_character;
-        //( + tmp2 :UINTEGER_8;
-        //  tmp2 := tmp.first;
-        //  `printf("Read '%c' (%02x)\n", @tmp2, @tmp2);`;
-        //);
+        last_character := tmp.first;
       };
     };
   );
@@ -106,5 +104,12 @@ Section Public
     };
   );
 
-// kate: hl Lisaac v0.2; indent-width 2; space-indent on; replace-tabs off;
+Section Private
+
+  - raw_read_character :CHARACTER <-
+  (
+    
+  );
+
+// kate: hl Lisaac v0.2; indent-width 2; space-indent on; replace-tabs on;
 // kate: tab-width 8; remove-trailing-space on;
diff --git a/lib/standard/file_system/file.li b/lib/standard/file_system/file.li
index 50feea1..62d2e04 100644
--- a/lib/standard/file_system/file.li
+++ b/lib/standard/file_system/file.li
@@ -155,7 +155,7 @@ Section FILE
     0
   )
   [
-    +? {cursor = Old cursor + s};
+    +? { (cursor = Old cursor + s ) || {cursor = size} };
   ];
     
   - physical_write buf:NATIVE_ARRAY(UINTEGER_8) size s:INTEGER :INTEGER <-

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list