tools/pas2c/PascalParser.hs
changeset 10131 4b4a043111f4
parent 10129 cd2a64a1f4aa
child 10245 3ccc054c3c3e
--- a/tools/pas2c/PascalParser.hs	Tue Feb 11 22:05:03 2014 +0400
+++ b/tools/pas2c/PascalParser.hs	Wed Feb 12 00:50:15 2014 +0400
@@ -629,7 +629,7 @@
         , char' '$' >> many hexDigit >>= \h -> comments >> return (InitHexNumber h)
         , char' '@' >> initExpression >>= \c -> comments >> return (InitAddress c)
         , try $ string' "nil" >> return InitNull
-        , itypeCast
+        , try itypeCast
         , iD >>= return . InitReference
         ]
 
@@ -681,10 +681,11 @@
         ]
 
     itypeCast = do
-        t <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) knownTypes
+        --t <- choice $ map (\s -> try $ caseInsensitiveString s >>= \i -> notFollowedBy alphaNum >> return i) knownTypes
+        t <- iD
         i <- parens pas initExpression
         comments
-        return $ InitTypeCast (Identifier t BTUnknown) i
+        return $ InitTypeCast t i
 
 builtInFunction :: Parsec String u a -> Parsec String u (String, [a])
 builtInFunction e = do