diff -r 46a9fde631f4 -r 75db7bb8dce8 tools/pas2c/PascalParser.hs --- a/tools/pas2c/PascalParser.hs Wed Jan 02 11:11:49 2013 +0100 +++ b/tools/pas2c/PascalParser.hs Sun Jan 27 00:28:57 2013 +0100 @@ -45,7 +45,7 @@ parens pas (liftM RefExpression expression >>= postfixes) >>= postfixes , try $ typeCast >>= postfixes , char '@' >> liftM Address reference >>= postfixes - , liftM SimpleReference iD >>= postfixes + , liftM SimpleReference iD >>= postfixes ] "simple reference" table = [ @@ -149,7 +149,7 @@ if null r then return $ ArrayDecl Nothing t else - return $ foldr (\a b -> ArrayDecl (Just a) b) (ArrayDecl (Just $ head r) t) (tail r) + return $ foldr (\a b -> ArrayDecl (Just a) b) (ArrayDecl (Just $ head r) t) (tail r) recordDecl = do try $ do optional $ (try $ string "packed") >> comments @@ -414,7 +414,7 @@ {-, [ Infix (try $ string "shl" >> return (BinOp "shl")) AssocNone , Infix (try $ string "shr" >> return (BinOp "shr")) AssocNone ] - , [ + , [ Infix (try $ string "or" >> return (BinOp "or")) AssocLeft , Infix (try $ string "xor" >> return (BinOp "xor")) AssocLeft ]-} @@ -510,7 +510,7 @@ optionMaybe $ choice [ try $ string "to" , try $ string "downto" - ] + ] --choice [string "to", string "downto"] comments e2 <- expression @@ -576,7 +576,7 @@ initExpression = buildExpressionParser table term "initialization expression" where term = comments >> choice [ - liftM (uncurry BuiltInFunction) $ builtInFunction initExpression + liftM (uncurry BuiltInFunction) $ builtInFunction initExpression , try $ brackets pas (commaSep pas $ initExpression) >>= return . InitSet , try $ parens pas (commaSep pas $ initExpression) >>= \ia -> when (null $ tail ia) mzero >> return (InitArray ia) , try $ parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord