From: Matthijs Kooijman Date: Thu, 19 Feb 2009 14:06:02 +0000 (+0100) Subject: Strip invalid characters from VHDL identifiers. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=383e69a4f5ec0b3aa7aa667a0adaf5655a67eee7;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Strip invalid characters from VHDL identifiers. --- diff --git a/VHDL.hs b/VHDL.hs index 1c7eba9..4ab3be3 100644 --- a/VHDL.hs +++ b/VHDL.hs @@ -326,4 +326,8 @@ vhdl_ty_maybe ty = -- 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