only comments, spacing, alpha-renaming
authorIsaac Dupree <id@isaac.cedarswampstudios.org>
Sat, 26 May 2007 18:08:00 +0000 (18:08 +0000)
committerIsaac Dupree <id@isaac.cedarswampstudios.org>
Sat, 26 May 2007 18:08:00 +0000 (18:08 +0000)
compiler/utils/StringBuffer.lhs

index 8eb6fc2..a1eddb0 100644 (file)
@@ -207,12 +207,14 @@ byteOff (StringBuffer buf _ cur) i =
     w <- peek (ptr `plusPtr` (cur+i))
     return (unsafeChr (fromIntegral (w::Word8)))
 
--- | XXX assumes ASCII digits only
+-- | XXX assumes ASCII digits only (by using byteOff)
 parseInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer
-parseInteger buf len radix to_int 
+parseInteger buf len radix char_to_int 
   = go 0 0
-  where go i x | i == len  = x
-              | otherwise = go (i+1) (x * radix + toInteger (to_int (byteOff buf i)))
+  where
+    go i x | i == len  = x
+           | otherwise = go (i+1)
+              (x * radix + toInteger (char_to_int (byteOff buf i)))
 
 -- -----------------------------------------------------------------------------
 -- under the carpet