From 383e69a4f5ec0b3aa7aa667a0adaf5655a67eee7 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 19 Feb 2009 15:06:02 +0100 Subject: [PATCH] Strip invalid characters from VHDL identifiers. --- VHDL.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.30.2