X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=VHDL.hs;h=4ab3be33ec2ba1a9a4647d62703e0efb801c811d;hb=383e69a4f5ec0b3aa7aa667a0adaf5655a67eee7;hp=b85d6ff0be288e7db0ec57ca886fae79cbc6ec09;hpb=14367b6b9fd0770a78e02fad425daa369df4bec6;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/VHDL.hs b/VHDL.hs index b85d6ff..4ab3be3 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -320,10 +320,14 @@ vhdl_ty_maybe ty = let name = TyCon.tyConName tycon in -- TODO: Do something more robust than string matching case Name.getOccString name of - "Bit" -> Just bit_ty + "Bit" -> Just std_logic_ty otherwise -> Nothing otherwise -> Nothing -- Shortcut mkVHDLId :: String -> AST.VHDLId -mkVHDLId = AST.unsafeVHDLBasicId +mkVHDLId s = + AST.unsafeVHDLBasicId s' + where + -- Strip invalid characters. + s' = filter (`elem` ['a'..'z'] ++ ['0'..'9'] ++ ['_']) s