tools/PascalParser.hs
changeset 6426 2d44f6561e72
parent 6425 1ef4192aa80d
child 6443 23364a5fcc86
--- a/tools/PascalParser.hs	Fri Nov 25 18:36:12 2011 +0300
+++ b/tools/PascalParser.hs	Fri Nov 25 23:22:35 2011 +0300
@@ -204,16 +204,19 @@
             optional $ (try $ string "packed") >> comments
             string "array"
         comments
-        r <- optionMaybe $ do
+        r <- option [] $ do
             char '['
-            r <- rangeDecl
+            r <- commaSep pas rangeDecl
             char ']'
             comments
             return r
         string "of"
         comments
         t <- typeDecl
-        return $ ArrayDecl r t
+        if null r then
+            return $ ArrayDecl Nothing t
+            else
+            return $ foldr (\a b -> ArrayDecl (Just a) b) (ArrayDecl (Just $ head r) t) (tail r) 
     recordDecl = do
         try $ do
             optional $ (try $ string "packed") >> comments