# HG changeset patch
# User unc0rr
# Date 1542568712 -3600
# Node ID b01770d42517050304d93afdaef623381d6c9f8a
# Parent  1d678dee55d188ca9227557b9fc8f4d816f8acce
Special case for rendering type of two-dimensional arrays, since C is inconsistent in its syntax

diff -r 1d678dee55d1 -r b01770d42517 tools/pas2c/Pas2C.hs
--- 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