563 initExpression = buildExpressionParser table term <?> "initialization expression" |
563 initExpression = buildExpressionParser table term <?> "initialization expression" |
564 where |
564 where |
565 term = comments >> choice [ |
565 term = comments >> choice [ |
566 liftM (uncurry BuiltInFunction) $ builtInFunction initExpression |
566 liftM (uncurry BuiltInFunction) $ builtInFunction initExpression |
567 , try $ brackets pas (commaSep pas $ initExpression) >>= return . InitSet |
567 , try $ brackets pas (commaSep pas $ initExpression) >>= return . InitSet |
568 , try $ parens pas (commaSep pas $ initExpression) >>= return . InitArray |
568 , try $ parens pas (commaSep pas $ initExpression) >>= \ia -> when (null $ tail ia) mzero >> return (InitArray ia) |
569 , parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord |
569 , try $ parens pas (sepEndBy recField (char ';' >> comments)) >>= return . InitRecord |
|
570 , parens pas initExpression |
570 , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . InitNumber . show) i |
571 , try $ integer pas >>= \i -> notFollowedBy (char '.') >> (return . InitNumber . show) i |
571 , try $ float pas >>= return . InitFloat . show |
572 , try $ float pas >>= return . InitFloat . show |
572 , try $ integer pas >>= return . InitNumber . show |
573 , try $ integer pas >>= return . InitNumber . show |
573 , stringLiteral pas >>= return . InitString |
574 , stringLiteral pas >>= return . InitString |
574 , char '#' >> many digit >>= \c -> comments >> return (InitChar c) |
575 , char '#' >> many digit >>= \c -> comments >> return (InitChar c) |