mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-12-15 10:46:37 +03:00
Change type of function numToken
to avoid use of fromInteger
.
This commit is contained in:
parent
74f7ee15ac
commit
b16f2cf2c6
@ -213,11 +213,11 @@ splitQual t =
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
numToken :: Integer -> Text -> TokenT
|
||||
numToken rad ds = Num (toVal ds') (fromInteger rad) (T.length ds')
|
||||
numToken :: Int {- ^ base -} -> Text -> TokenT
|
||||
numToken rad ds = Num (toVal ds') rad (T.length ds')
|
||||
where
|
||||
ds' = T.filter (/= '_') ds
|
||||
toVal = T.foldl' (\x c -> rad * x + fromDigit c) 0
|
||||
toVal = T.foldl' (\x c -> toInteger rad * x + fromDigit c) 0
|
||||
|
||||
fromDigit :: Char -> Integer
|
||||
fromDigit x'
|
||||
|
Loading…
Reference in New Issue
Block a user