Add stringToVHDLExpr function.
[matthijs/master-project/cλash.git] / clash / CLasH / VHDL / VHDLTools.hs
index 165b1ef655710195d244dd13ade22cd243be218d..7677369a59c784c516464e9030eb07742fdfa257 100644 (file)
@@ -162,6 +162,11 @@ idToVHDLExpr = vhdlNameToVHDLExpr . AST.NSimple
 -- Turn a Core expression into an AST expression
 exprToVHDLExpr core = varToVHDLExpr (exprToVar core)
 
+-- Turn a String into a VHDL expr containing an id
+stringToVHDLExpr :: String -> AST.Expr
+stringToVHDLExpr = idToVHDLExpr . mkVHDLExtId 
+
+
 -- Turn a alternative constructor into an AST expression. For
 -- dataconstructors, this is only the constructor itself, not any arguments it
 -- has. Should not be called with a DEFAULT constructor.