develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33657 - in branches/pdd22io_part2/languages/lua: . src/lib

From:
fperrad
Date:
December 8, 2008 07:59
Subject:
[svn:parrot] r33657 - in branches/pdd22io_part2/languages/lua: . src/lib
Message ID:
20081208155942.4392ECB9AF@x12.develooper.com
Author: fperrad
Date: Mon Dec  8 07:59:40 2008
New Revision: 33657

Modified:
   branches/pdd22io_part2/languages/lua/luac2pir.pir
   branches/pdd22io_part2/languages/lua/luad.pir
   branches/pdd22io_part2/languages/lua/src/lib/luaaux.pir
   branches/pdd22io_part2/languages/lua/src/lib/luaperl.pir

Log:
[pdd22io] Lua
- replace ParrotIO.slurp() by FileHandle.readall()
(TODO: error handling)

Modified: branches/pdd22io_part2/languages/lua/luac2pir.pir
==============================================================================
--- branches/pdd22io_part2/languages/lua/luac2pir.pir	(original)
+++ branches/pdd22io_part2/languages/lua/luac2pir.pir	Mon Dec  8 07:59:40 2008
@@ -62,11 +62,11 @@
 
 .sub 'load_file' :anon
     .param string filename
-    .local pmc pio
+    .local pmc fh
     .local string content
-    pio = new 'ParrotIO'
+    fh = new 'FileHandle'
     push_eh _handler
-    content = pio.'slurp'(filename)
+    content = fh.'readall'(filename)
     pop_eh
     if content goto L1
     $S0 = err

Modified: branches/pdd22io_part2/languages/lua/luad.pir
==============================================================================
--- branches/pdd22io_part2/languages/lua/luad.pir	(original)
+++ branches/pdd22io_part2/languages/lua/luad.pir	Mon Dec  8 07:59:40 2008
@@ -65,11 +65,11 @@
 
 .sub 'load_file'
     .param string filename
-    .local pmc pio
+    .local pmc fh
     .local string content
-    pio = new 'ParrotIO'
+    fh = new 'FileHandle'
     push_eh _handler
-    content = pio.'slurp'(filename)
+    content = fh.'readall'(filename)
     pop_eh
     if content goto L1
     $S0 = err

Modified: branches/pdd22io_part2/languages/lua/src/lib/luaaux.pir
==============================================================================
--- branches/pdd22io_part2/languages/lua/src/lib/luaaux.pir	(original)
+++ branches/pdd22io_part2/languages/lua/src/lib/luaaux.pir	Mon Dec  8 07:59:40 2008
@@ -654,7 +654,7 @@
     f = open filename, '<'
     unless f goto L3
   L2:
-    $S0 = f.'slurp'('')
+    $S0 = f.'readall'()
     if filename == '' goto L4
     close f
   L4:

Modified: branches/pdd22io_part2/languages/lua/src/lib/luaperl.pir
==============================================================================
--- branches/pdd22io_part2/languages/lua/src/lib/luaperl.pir	(original)
+++ branches/pdd22io_part2/languages/lua/src/lib/luaperl.pir	Mon Dec  8 07:59:40 2008
@@ -75,7 +75,7 @@
     .local string content
     pio = new 'ParrotIO'
     push_eh _handler
-    content = pio.'slurp'(filename)
+    content = pio.'readall'(filename)
     pop_eh
     if content goto L1
     $S0 = err
@@ -108,7 +108,7 @@
     pir = load_script($S1)
     if pir goto L1
     $P0 = new 'ParrotIO'
-    $S0 = $P0.'slurp'(out)
+    $S0 = $P0.'readall'(out)
     unlink(out)  # cleaning up the temporary file
     die $S0
   L1:



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About