corrected parsing joined with unC0Rr's corrected generating finally gives the right result
authoralfadur
Mon, 19 Nov 2018 09:29:37 +0300
changeset 14236 0f8b647ea317
parent 14235 3a9e4f35aa68
child 14237 81fba21495a5
corrected parsing joined with unC0Rr's corrected generating finally gives the right result
tools/pas2c/Pas2C.hs
--- a/tools/pas2c/Pas2C.hs	Mon Nov 19 06:57:36 2018 +0300
+++ b/tools/pas2c/Pas2C.hs	Mon Nov 19 09:29:37 2018 +0300
@@ -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 r2' <> brackets r1'
     type2C' (ArrayDecl (Just r) t) = do
         t' <- type2C t
         lt <- gets lastType