tools/PascalParser.hs
changeset 6452 7c6f9b6672dc
parent 6450 14224c9b4594
child 6453 11c578d30bd3
equal deleted inserted replaced
6450:14224c9b4594 6452:7c6f9b6672dc
   432     term = comments >> choice [
   432     term = comments >> choice [
   433         builtInFunction expression >>= \(n, e) -> return $ BuiltInFunCall e (SimpleReference (Identifier n))
   433         builtInFunction expression >>= \(n, e) -> return $ BuiltInFunCall e (SimpleReference (Identifier n))
   434         , parens pas $ expression 
   434         , parens pas $ expression 
   435         , brackets pas (commaSep pas iD) >>= return . SetExpression
   435         , brackets pas (commaSep pas iD) >>= return . SetExpression
   436         , try $ natural pas >>= \i -> notFollowedBy (char '.') >> (return . NumberLiteral . show) i
   436         , try $ natural pas >>= \i -> notFollowedBy (char '.') >> (return . NumberLiteral . show) i
   437         , try $ float pas >>= return . FloatLiteral . show
   437         , float pas >>= return . FloatLiteral . show
   438         , try $ natural pas >>= return . NumberLiteral . show
   438         , natural pas >>= return . NumberLiteral . show
   439         , stringLiteral pas >>= return . StringLiteral
   439         , stringLiteral pas >>= return . StringLiteral
   440         , try (string "#$") >> many hexDigit >>= \c -> comments >> return (HexCharCode c)
   440         , try (string "#$") >> many hexDigit >>= \c -> comments >> return (HexCharCode c)
   441         , char '#' >> many digit >>= \c -> comments >> return (CharCode c)
   441         , char '#' >> many digit >>= \c -> comments >> return (CharCode c)
   442         , char '$' >> many hexDigit >>=  \h -> comments >> return (HexNumber h)
   442         , char '$' >> many hexDigit >>=  \h -> comments >> return (HexNumber h)
   443         , char '-' >> expression >>= return . PrefixOp "-"
   443         , char '-' >> expression >>= return . PrefixOp "-"