From 5d5f027e40440de10abdcfef4208fe590210deec Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 8 Aug 2017 12:14:42 -0400 Subject: [PATCH] Handle errors at the top level. --- src/Language/Python/Syntax.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Language/Python/Syntax.hs b/src/Language/Python/Syntax.hs index 1e9d1424a..baa770fa0 100644 --- a/src/Language/Python/Syntax.hs +++ b/src/Language/Python/Syntax.hs @@ -14,7 +14,7 @@ import Data.Functor.Classes.Show.Generic import Data.Maybe (fromMaybe) import Data.Tuple (swap) import Data.Record -import Data.Syntax (emptyTerm, handleError, makeTerm, parseError) +import Data.Syntax (emptyTerm, handleError, makeTerm) import qualified Data.Syntax as Syntax import Data.Syntax.Assignment hiding (Assignment, Error) import qualified Data.Syntax.Assignment as Assignment @@ -102,7 +102,7 @@ instance Show1 Redirect where liftShowsPrec = genericLiftShowsPrec -- | Assignment from AST in Python's grammar onto a program in Python's syntax. assignment :: Assignment -assignment = makeTerm <$> symbol Module <*> children (Syntax.Program <$> many expression) <|> parseError +assignment = handleError $ makeTerm <$> symbol Module <*> children (Syntax.Program <$> many expression) expression :: Assignment expression = handleError $