# HG changeset patch # User unc0rr # Date 1350412501 -14400 # Node ID d2fd8040534fe9824265cdb2e730e9bf0221bb2d # Parent 6dc1be8ff73ed76821891c53be43f7a7a42be44f Better error handling diff -r 6dc1be8ff73e -r d2fd8040534f tools/PascalParser.hs --- a/tools/PascalParser.hs Tue Oct 16 13:41:23 2012 -0400 +++ b/tools/PascalParser.hs Tue Oct 16 22:35:01 2012 +0400 @@ -369,7 +369,7 @@ , char '$' >> many hexDigit >>= \h -> comments >> return (HexNumber h) --, char '-' >> expression >>= return . PrefixOp "-" , char '-' >> reference >>= return . PrefixOp "-" . Reference - , try $ string "not" >> error "unexpected not in term" + , (try $ string "not" >> notFollowedBy comments) >> unexpected "'not'" , try $ string "nil" >> return Null , reference >>= return . Reference ] "simple expression" diff -r 6dc1be8ff73e -r d2fd8040534f tools/PascalPreprocessor.hs --- a/tools/PascalPreprocessor.hs Tue Oct 16 13:41:23 2012 -0400 +++ b/tools/PascalPreprocessor.hs Tue Oct 16 22:35:01 2012 +0400 @@ -121,7 +121,7 @@ try $ string "DEFINE" spaces i <- identifier - d <- ((string ":=" >> return ())<|> spaces) >> many (noneOf "}") + d <- ((string ":=" >> return ()) <|> spaces) >> many (noneOf "}") char '}' updateState $ \(m, b) -> (if (and b) && (head i /= '_') then Map.insert i d m else m, b) return ""