# HG changeset patch
# User unc0rr
# Date 1347823855 -14400
# Node ID 6ef121a80cb0264e361f40f0274559430b2abf77
# Parent  9daa061885515793afbeac9d2727dff3ba45f38a
Treat init expression in parens as just expression instead of array initializer when there's only one entry in expressions list

diff -r 9daa06188551 -r 6ef121a80cb0 tools/PascalParser.hs
--- a/tools/PascalParser.hs	Sun Sep 16 22:55:33 2012 +0400
+++ b/tools/PascalParser.hs	Sun Sep 16 23:30:55 2012 +0400
@@ -565,8 +565,9 @@
     term = comments >> choice [
         liftM (uncurry BuiltInFunction) $ builtInFunction initExpression 
         , try $ brackets pas (commaSep pas $ initExpression) >>= return . InitSet
-        , try $ parens pas (commaSep pas $ initExpression) >>= return . InitArray
-        , parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord
+        , try $ parens pas (commaSep pas $ initExpression) >>= \ia -> when (null $ tail ia) mzero >> return (InitArray ia)
+        , try $ parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord
+        , parens pas initExpression
         , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . InitNumber . show) i
         , try $ float pas >>= return . InitFloat . show
         , try $ integer pas >>= return . InitNumber . show