[svn:parrot] r44300 - trunk/tools/dev

plobsing at svn.parrot.org plobsing at svn.parrot.org
Mon Feb 22 19:06:13 UTC 2010


Author: plobsing
Date: Mon Feb 22 19:06:11 2010
New Revision: 44300
URL: https://trac.parrot.org/parrot/changeset/44300

Log:
ignore CR as well as LF as whitespace in nci signature files. This should make windows explode less.

Modified:
   trunk/tools/dev/nci_thunk_gen.pir

Modified: trunk/tools/dev/nci_thunk_gen.pir
==============================================================================
--- trunk/tools/dev/nci_thunk_gen.pir	Mon Feb 22 18:58:10 2010	(r44299)
+++ trunk/tools/dev/nci_thunk_gen.pir	Mon Feb 22 19:06:11 2010	(r44300)
@@ -745,18 +745,21 @@
     end_comment:
 
     # convert whitespace into spaces
-    $S0 = '\t'
-    whitespace_loop:
-        $I0 = index line, $S0
-        if $I0 < 0 goto end_whitespace_loop
-        substr line, $I0, 1, ' '
-        goto whitespace_loop
-    end_whitespace_loop:
-
-    if $S0 == "\n" goto end_whitespace
-        $S0 = "\n"
-        goto whitespace_loop
-    end_whitespace:
+    .const 'Sub' $P0 = 'alternate_whitespaces'
+    $P1 = iter $P0
+    outer_whitespace_loop:
+        unless $P1 goto end_outer_whitespace_loop
+        $S0 = shift $P1
+
+        inner_whitespace_loop:
+            $I0 = index line, $S0
+            if $I0 < 0 goto end_inner_whitespace_loop
+            substr line, $I0, 1, ' '
+            goto inner_whitespace_loop
+        end_inner_whitespace_loop:
+
+        goto outer_whitespace_loop
+    end_outer_whitespace_loop:
 
     # turn multiple spaces into a single space
     multispace_loop:
@@ -1097,6 +1100,14 @@
     .return (dir, file, extn)
 .end
 
+.sub 'alternate_whitespaces' :anon :immediate
+    $P0 = new ['ResizableStringArray']
+    push $P0, "\t"
+    push $P0, "\n"
+    push $P0, "\r"
+    .return ($P0)
+.end
+
 # }}}
 
 # Local Variables:


More information about the parrot-commits mailing list