From b964324d09c0c7a3b4de5cdad8b0edbd5d89b253 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Fri, 9 Nov 2018 13:16:15 -0800 Subject: [PATCH] Only stat errors once per path --- src/Semantic/Task.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Semantic/Task.hs b/src/Semantic/Task.hs index 23fec849d..a7221351f 100644 --- a/src/Semantic/Task.hs +++ b/src/Semantic/Task.hs @@ -334,13 +334,13 @@ runParser blob@Blob{..} parser = case parser of logError config Error blob err (("task", "assign") : blobFields) throwError (toException err) Right term -> do - for_ (errors term) $ \ err -> case Error.errorActual err of + for_ (zip (errors term) [(0::Integer)..]) $ \ (err, i) -> case Error.errorActual err of Just "ParseError" -> do - writeStat (increment "parse.parse_errors" languageTag) + when (i == 0) $ writeStat (increment "parse.parse_errors" languageTag) logError config Warning blob err (("task", "parse") : blobFields) when (optionsFailOnParseError (configOptions config)) $ throwError (toException err) _ -> do - writeStat (increment "parse.assign_warnings" languageTag) + when (i == 0) $ writeStat (increment "parse.assign_warnings" languageTag) logError config Warning blob err (("task", "assign") : blobFields) when (optionsFailOnWarning (configOptions config)) $ throwError (toException err) term <$ writeStat (count "parse.nodes" (length term) languageTag)