Skip to content
Snippets Groups Projects
Commit 8f9a7966 authored by chrg's avatar chrg
Browse files

This wierdly works.

parent 7a002e4c
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,15 @@ instance CReducible C.CDeclaration where
pure $ C.CDeclarationItem d Nothing Nothing
a -> error (show a)
pure (C.CDecl spc decl' ni)
C.CDecl spc@[C.CTypeSpec (C.CTypeDef i ni')] decl ni -> do
x <- gets (Map.lookup i)
case x of
Just (Type rst) -> do
decl' <- collectNonEmpty' (reduceCDeclarationItem $ identifiers rst) decl
pure $ C.CDecl rst decl' ni
Nothing -> do
decl' <- collectNonEmpty' (reduceCDeclarationItem $ identifiers spc) decl
pure $ C.CDecl spc decl' ni
C.CDecl spc decl ni -> do
decl' <- collectNonEmpty' (reduceCDeclarationItem $ identifiers spc) decl
pure $ C.CDecl spc decl' ni
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment