From dbd4ff109c85ee300f22894188c79d28dce64a8e Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 4 Jul 2013 13:07:27 -0700 Subject: [PATCH] Mention second level structure being parsed when error. --- ShellCheck/Parser.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 6e29d47..8e9834e 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -1608,8 +1608,11 @@ parseShell filename contents = do (Left err, (p, context)) -> ParseResult Nothing (nub $ sortNotes $ p ++ (notesForContext context) ++ ([makeErrorFor err])) where - notesForContext r = map contextNote $ take 1 r - contextNote (pos, str) = ParseNote pos ErrorC $ "This " ++ str ++" is malformed." + notesForContext list = zipWith ($) [first, second] list + 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 ltt t x = trace (show t) x