mirror of https://github.com/zachjs/sv2v.git
signed size cast shorthand output
This commit is contained in:
parent
e80db12422
commit
d9e890c88e
|
|
@ -118,6 +118,9 @@ traverseExprM =
|
|||
_ -> return $ Cast (Right s) e
|
||||
|
||||
convertCastWithSigningM :: Expr -> Expr -> Signing -> Scoper Type Expr
|
||||
convertCastWithSigningM (RawNum size) (RawNum val) Signed =
|
||||
return $ Number $ Decimal (fromIntegral size) True val'
|
||||
where val' = val `mod` (2 ^ size)
|
||||
convertCastWithSigningM s e sg = do
|
||||
details <- lookupElemM $ castFnName s sg
|
||||
when (details == Nothing) $ injectItem $ MIPackageItem $ castFn s sg
|
||||
|
|
|
|||
Loading…
Reference in New Issue