summaryrefslogtreecommitdiff
path: root/compiler/utils/StringBuffer.lhs
diff options
context:
space:
mode:
authorIsaac Dupree <id@isaac.cedarswampstudios.org>2007-05-26 21:22:04 +0000
committerIsaac Dupree <id@isaac.cedarswampstudios.org>2007-05-26 21:22:04 +0000
commit4a1aca1033549f95cbdb62cbc0aac331610c91ea (patch)
tree644e5e0872ee810f0c85c83980501c2c0a955aa5 /compiler/utils/StringBuffer.lhs
parenta12dcc89780ddec69beec723ac444c5fab388a9a (diff)
downloadhaskell-4a1aca1033549f95cbdb62cbc0aac331610c91ea.tar.gz
parseInteger->parseUnsignedInteger to clarify meaning
I decided against adding parseSignedInteger since octal and hex literals often have junk between the '-' and the digits, but, compare to Util.readRational which does handle signed numbers. Also since Integers - mathematically and in Haskell - can be negative, normally.
Diffstat (limited to 'compiler/utils/StringBuffer.lhs')
-rw-r--r--compiler/utils/StringBuffer.lhs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/utils/StringBuffer.lhs b/compiler/utils/StringBuffer.lhs
index a1eddb0280..28a7f6728d 100644
--- a/compiler/utils/StringBuffer.lhs
+++ b/compiler/utils/StringBuffer.lhs
@@ -33,7 +33,7 @@ module StringBuffer
lexemeToFastString,
-- * Parsing integers
- parseInteger,
+ parseUnsignedInteger,
) where
#include "HsVersions.h"
@@ -208,8 +208,8 @@ byteOff (StringBuffer buf _ cur) i =
return (unsafeChr (fromIntegral (w::Word8)))
-- | XXX assumes ASCII digits only (by using byteOff)
-parseInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer
-parseInteger buf len radix char_to_int
+parseUnsignedInteger :: StringBuffer -> Int -> Integer -> (Char->Int) -> Integer
+parseUnsignedInteger buf len radix char_to_int
= go 0 0
where
go i x | i == len = x