equal
deleted
inserted
replaced
772 is <- mapM (id2C IOInsert . setBaseType bt) ids |
772 is <- mapM (id2C IOInsert . setBaseType bt) ids |
773 return (text "enum" <+> (braces . vcat . punctuate comma . map (\(a, b) -> a <+> equals <+> text "0x" <> text (showHex b "")) $ zip is [0..]) <+>) |
773 return (text "enum" <+> (braces . vcat . punctuate comma . map (\(a, b) -> a <+> equals <+> text "0x" <> text (showHex b "")) $ zip is [0..]) <+>) |
774 where |
774 where |
775 bt = BTEnum $ map (\(Identifier i _) -> map toLower i) ids |
775 bt = BTEnum $ map (\(Identifier i _) -> map toLower i) ids |
776 type2C' (ArrayDecl Nothing t) = type2C (PointerTo t) |
776 type2C' (ArrayDecl Nothing t) = type2C (PointerTo t) |
777 type2C' (ArrayDecl (Just r1) (ArrayDecl (Just r2) t)) = do |
|
778 t' <- type2C t |
|
779 lt <- gets lastType |
|
780 r1' <- initExpr2C (InitRange r1) |
|
781 r2' <- initExpr2C (InitRange r2) |
|
782 return $ \i -> t' i <> brackets r2' <> brackets r1' |
|
783 type2C' (ArrayDecl (Just r) t) = do |
777 type2C' (ArrayDecl (Just r) t) = do |
784 t' <- type2C t |
778 t' <- type2C t |
785 lt <- gets lastType |
779 lt <- gets lastType |
786 ft <- case lt of |
780 ft <- case lt of |
787 -- BTFunction {} -> type2C (PointerTo t) |
781 -- BTFunction {} -> type2C (PointerTo t) |