@@ -140,6 +140,7 @@ inputHole = \case
140
140
DevNull _ -> Nothing
141
141
SigD _ nM -> nM
142
142
CtxName -> Nothing
143
+ EscapedSymbol _ -> Nothing
143
144
144
145
-- | Determine if the number of normal\/literal\/function inputs of a blackbox
145
146
-- context at least matches the number of argument that is expected by the
@@ -923,6 +924,9 @@ renderTag b CtxName = case bbCtxName b of
923
924
-> return (Id. toLazyText t)
924
925
_ -> error " internal error"
925
926
927
+ renderTag _ (EscapedSymbol sym) = case sym of
928
+ SquareBracketOpen -> return " ["
929
+ SquareBracketClose -> return " ]"
926
930
927
931
renderTag _ e = do e' <- getAp (prettyElem e)
928
932
error $ $ (curLoc) ++ " Unable to evaluate: " ++ show e'
@@ -1127,6 +1131,9 @@ prettyElem (Template bbname source) = do
1127
1131
<> brackets (string $ Text. concat bbname')
1128
1132
<> brackets (string $ Text. concat source'))
1129
1133
prettyElem CtxName = return " ~CTXNAME"
1134
+ prettyElem (EscapedSymbol sym) = case sym of
1135
+ SquareBracketOpen -> return " [\\ "
1136
+ SquareBracketClose -> return " \\ ]"
1130
1137
1131
1138
-- | Recursively walk @Element@, applying @f@ to each element in the tree.
1132
1139
walkElement
@@ -1197,6 +1204,7 @@ walkElement f el = maybeToList (f el) ++ walked
1197
1204
Repeat es1 es2 ->
1198
1205
concatMap go es1 ++ concatMap go es2
1199
1206
CtxName -> []
1207
+ EscapedSymbol _ -> []
1200
1208
1201
1209
-- | Determine variables used in an expression. Used for VHDL sensitivity list.
1202
1210
-- Also see: https://github.com/clash-lang/clash-compiler/issues/365
@@ -1285,6 +1293,7 @@ getUsedArguments (N.BBTemplate t) = nub (concatMap (walkElement matchArg) t)
1285
1293
TypM _ -> Nothing
1286
1294
Vars _ -> Nothing
1287
1295
CtxName -> Nothing
1296
+ EscapedSymbol _ -> Nothing
1288
1297
1289
1298
onBlackBox
1290
1299
:: (BlackBoxTemplate -> r )
0 commit comments