Special case for rendering type of two-dimensional arrays, since C is inconsistent in its syntax
--- a/tools/pas2c/Pas2C.hs Sun Nov 18 12:21:03 2018 -0500
+++ b/tools/pas2c/Pas2C.hs Sun Nov 18 20:18:32 2018 +0100
@@ -774,6 +774,12 @@
where
bt = BTEnum $ map (\(Identifier i _) -> map toLower i) ids
type2C' (ArrayDecl Nothing t) = type2C (PointerTo t)
+ type2C' (ArrayDecl (Just r1) (ArrayDecl (Just r2) t)) = do
+ t' <- type2C t
+ lt <- gets lastType
+ r1' <- initExpr2C (InitRange r1)
+ r2' <- initExpr2C (InitRange r2)
+ return $ \i -> t' i <> brackets r1' <> brackets r2'
type2C' (ArrayDecl (Just r) t) = do
t' <- type2C t
lt <- gets lastType