mirror of
https://github.com/zachjs/sv2v.git
synced 2026-08-31 17:54:22 +02:00
use unbounded integers
This commit is contained in:
@@ -66,9 +66,7 @@ traverseExprM =
|
||||
where
|
||||
str = (show size) ++ "'d" ++ (show num)
|
||||
size = s'
|
||||
num = if size >= 32
|
||||
then n' -- already read as 32 bits
|
||||
else n' `mod` (2 ^ s')
|
||||
num = n' `mod` (2 ^ s')
|
||||
_ -> convertCastM (Number s) (Number n)
|
||||
convertExprM (orig @ (Cast (Right DimsFn{}) _)) =
|
||||
return orig
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
module Convert.TypeOf (convert) where
|
||||
|
||||
import Data.List (elemIndex)
|
||||
import Data.Int (Int32)
|
||||
import Data.Tuple (swap)
|
||||
import qualified Data.Map.Strict as Map
|
||||
|
||||
@@ -140,7 +139,7 @@ typeof (Repeat reps exprs) = return $ typeOfSize size
|
||||
typeof other = lookupTypeOf other
|
||||
|
||||
-- determines the size and sign of a number literal
|
||||
parseNumber :: String -> (Int32, Signing)
|
||||
parseNumber :: String -> (Integer, Signing)
|
||||
parseNumber s =
|
||||
case elemIndex '\'' s of
|
||||
Nothing -> (32, Signed)
|
||||
|
||||
Reference in New Issue
Block a user