File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -287,10 +287,13 @@ catsForPOS env = M.fromListWith (++) $
287287-- CId (AbsType,(([CId],AbsTree),[Label]))
288288expandMacro :: UDEnv -> AbsTree -> AbsTree
289289expandMacro env tr@ (RTree f ts) = case M. lookup f (macroFunctions (cncLabels env)) of
290- Just (MacroFunction _ xx df _) -> subst (zip xx (map (expandMacro env) ts)) df
291- _ -> RTree f (map (expandMacro env) ts)
290+ Just (MacroFunction _ xx df _) | length ts' == length xx ->
291+ subst (zip xx ts') df
292+ _ -> RTree f ts'
292293 where
293- subst xts t@ (RTree h us) = case us of
294+ ts' = map (expandMacro env) ts
295+ subst xts t@ (RTree h us) =
296+ case us of
294297 [] -> maybe t id (lookup h xts)
295298 -- Expand head: #auxfun Ex a b : A -> B -> C = a b ; cn head
296299 _ | Just (RTree h' hus) <- lookup h xts -> expandMacro env $ RTree h' (hus ++ map (subst xts) us)
You can’t perform that action at this time.
0 commit comments