Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
8226f00b
Commit
8226f00b
authored
May 26, 2007
by
Isaac Dupree
Browse files
only comments, spacing, alpha-renaming
parent
230aa727
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/utils/StringBuffer.lhs
View file @
8226f00b
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment