Unicode data parsing script incorrect for char-set:ascii
authorMichael Gran <spk121@yahoo.com>
Sat, 3 Apr 2010 04:08:42 +0000 (21:08 -0700)
committerMichael Gran <spk121@yahoo.com>
Sat, 3 Apr 2010 04:08:42 +0000 (21:08 -0700)
char-set:ascii is the only char-set consisting of a single contiguous
range, and there was an off-by-one error for that case.

* libguile/unidata_to_charset.pl (compute): fix off-by-one

libguile/unidata_to_charset.pl
test-suite/tests/srfi-14.test

index d086c8ec464483d2cd8e12547a379a715ccb0821..961dba60c2a67249e96f349c668ec230b065a713 100755 (executable)
@@ -340,8 +340,9 @@ sub compute {
             $rend[$len] = $end;
             $len++;
         } elsif ($len == 0) {
-            $rstart[0] = $start;
-            $rend[0] = $end;
+           $rstart[0] = $start;
+           $rend[0] = $end;
+           $len++;
         }
     }
 
index f12a2557c4ff477a3da93625bf175c7a171adf06..93b1883aa88ad4446b4de7dbad4ecc0e466231a9 100644 (file)
                                      (integer->char #x20))))
                  char-set:printing))
 
+  (pass-if "char-set:ASCII"
+     (char-set= (ucs-range->char-set 0 128)
+                char-set:ascii))
+
   (pass-if "char-set:iso-control"
-     (char-set<= (string->char-set 
-                  (apply string 
-                         (map integer->char (append 
+     (char-set<= (string->char-set
+                  (apply string
+                         (map integer->char (append
                                              ;; U+0000 to U+001F
                                              (iota #x20)
                                              (list #x7f)))))