X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=FlattenTypes.hs;h=b7be4645d89e1df519487192268d48d4ab6e978c;hb=db63e913f56b427533d29327b25a14b6b75b6d79;hp=f75b0d51e64ae9f476627e1d6477062660b1cd5b;hpb=c0fa1614f8bb0126868658fad79b01df447e113a;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/FlattenTypes.hs b/FlattenTypes.hs index f75b0d5..b7be464 100644 --- a/FlattenTypes.hs +++ b/FlattenTypes.hs @@ -96,6 +96,12 @@ data SigDef = defDst :: SignalId } deriving (Show, Eq) +-- | Is the given SigDef a FApp? +is_FApp :: SigDef -> Bool +is_FApp d = case d of + (FApp _ _ _) -> True + _ -> False + -- | An expression on signals data SignalExpr = EqLit SignalId String -- ^ Is the given signal equal to the given (VHDL) literal @@ -193,8 +199,12 @@ addNameHint :: String -> SignalId -> FlattenState () addNameHint hint id = do info <- getSignalInfo id let hints = nameHints info - let hints' = (hint:hints) - setSignalInfo id (info {nameHints = hints'}) + if hint `elem` hints + then do + return () + else do + let hints' = (hint:hints) + setSignalInfo id (info {nameHints = hints'}) -- | Returns the SignalInfo for the given signal. Errors if the signal is not -- known in the session.