mirror of
https://github.com/zachjs/sv2v.git
synced 2026-09-07 19:56:44 +02:00
added pass-through support for strings
This commit is contained in:
@@ -170,7 +170,9 @@ traverseDeclM structs origDecl = do
|
||||
case origDecl of
|
||||
Variable d t x a me -> do
|
||||
let (tf, rs) = typeRanges t
|
||||
modify $ Map.insert x (tf $ a ++ rs)
|
||||
if isRangeable t
|
||||
then modify $ Map.insert x (tf $ a ++ rs)
|
||||
else return ()
|
||||
case me of
|
||||
Nothing -> return origDecl
|
||||
Just e -> do
|
||||
@@ -188,6 +190,10 @@ traverseDeclM structs origDecl = do
|
||||
types <- get
|
||||
let (LHSIdent _, e') = convertAsgn structs types (LHSIdent x, e)
|
||||
return e'
|
||||
isRangeable :: Type -> Bool
|
||||
isRangeable (IntegerAtom _ _) = False
|
||||
isRangeable (NonInteger _ ) = False
|
||||
isRangeable _ = True
|
||||
|
||||
-- produces a function which packs the components of a struct literal
|
||||
packerFn :: TypeFunc -> ModuleItem
|
||||
|
||||
@@ -146,6 +146,7 @@ data NonIntegerType
|
||||
= TShortreal
|
||||
| TReal
|
||||
| TRealtime
|
||||
| TString
|
||||
deriving (Eq, Ord)
|
||||
|
||||
instance Show NetType where
|
||||
@@ -176,6 +177,7 @@ instance Show NonIntegerType where
|
||||
show TShortreal = "shortreal"
|
||||
show TReal = "real"
|
||||
show TRealtime = "realtime"
|
||||
show TString = "string"
|
||||
|
||||
data Packing
|
||||
= Unpacked
|
||||
|
||||
@@ -485,6 +485,7 @@ NonIntegerType :: { NonIntegerType }
|
||||
: "shortreal" { TShortreal }
|
||||
| "real" { TReal }
|
||||
| "realtime" { TRealtime }
|
||||
| "string" { TString }
|
||||
|
||||
EnumItems :: { [(Identifier, Maybe Expr)] }
|
||||
: VariablePortIdentifiers { $1 }
|
||||
|
||||
Reference in New Issue
Block a user