Skip to content

Commit 3d59df3

Browse files
committed
prettyBlackBox: Correctly escape [ and ]
This fixes #2988.
1 parent 62c1d6c commit 3d59df3

File tree

1 file changed

+1
-1
lines changed
  • clash-lib/src/Clash/Netlist/BlackBox

1 file changed

+1
-1
lines changed

clash-lib/src/Clash/Netlist/BlackBox/Util.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ prettyElem
988988
:: (HasCallStack, Monad m)
989989
=> Element
990990
-> Ap m Text
991-
prettyElem (Text t) = return t
991+
prettyElem (Text t) = return $ Text.replace "[" "[\\" $ Text.replace "]" "\\]" t
992992
prettyElem (Component (Decl i 0 args)) = do
993993
args' <- mapM (\(a,b) -> (,) <$> prettyBlackBox a <*> prettyBlackBox b) args
994994
case args' of

0 commit comments

Comments
 (0)