diff options
Diffstat (limited to 'DSL/StdLib.hs')
| -rw-r--r-- | DSL/StdLib.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/DSL/StdLib.hs b/DSL/StdLib.hs index 360e139..09c5338 100644 --- a/DSL/StdLib.hs +++ b/DSL/StdLib.hs @@ -3,16 +3,17 @@ module DSL.StdLib (stdlib) where import Data.Map.Strict (fromList) import DSL.Types -import DSL.BaseParsers (parse, mult, chain) +import DSL.BaseParsers (parse, mult, chain, nicePrintParserError) import DSL.Parsing (tokenizer, procP) stdlib :: ProcTable stdlib = procs where p = tokenizer `chain` mult procP + m = "Failed to parse standard library:\n" procs = case parse p (unlines sources) of - Nothing -> error "Failed to parse standard library" - Just (_, ps) -> fromList ps + Right (_, ps) -> fromList ps + Left e -> error $ m ++ nicePrintParserError e sources :: [String] sources = [ div' |
