Mention second level structure being parsed when error.

This commit is contained in:
Vidar Holen 2013-07-04 13:07:27 -07:00
parent d2c5802a9d
commit dbd4ff109c
1 changed files with 5 additions and 2 deletions

View File

@ -1608,8 +1608,11 @@ parseShell filename contents = do
(Left err, (p, context)) -> ParseResult Nothing (nub $ sortNotes $ p ++ (notesForContext context) ++ ([makeErrorFor err])) (Left err, (p, context)) -> ParseResult Nothing (nub $ sortNotes $ p ++ (notesForContext context) ++ ([makeErrorFor err]))
where where
notesForContext r = map contextNote $ take 1 r notesForContext list = zipWith ($) [first, second] list
contextNote (pos, str) = ParseNote pos ErrorC $ "This " ++ str ++" is malformed." first (pos, str) = ParseNote pos ErrorC $
"Couldn't parse this " ++ str ++ "."
second (pos, str) = ParseNote pos InfoC $
"The mentioned parser error was in this " ++ str ++ "."
lt x = trace (show x) x lt x = trace (show x) x
ltt t x = trace (show t) x ltt t x = trace (show t) x