Do not count warnings for considering exactprint fallback

Lennart Spitzner 2023-04-17 09:12:54 +00:00
parent 7d4d6e77f7
commit 9b5fb89c2b
1 changed files with 24 additions and 12 deletions

View File

@ -170,22 +170,34 @@ newtype CommentCounter = CommentCounter { unCommentCounter :: Int }
-- to remember to call `docFlushRemaining` in combination with this! -- to remember to call `docFlushRemaining` in combination with this!
briDocMToPPM :: ToBriDocM a -> PPMLocal (a, Int) briDocMToPPM :: ToBriDocM a -> PPMLocal (a, Int)
briDocMToPPM m = do briDocMToPPM m = do
readers <- MultiRWSS.mGetRawR readers <- MultiRWSS.mGetRawR
initCount <- MultiRWSS.mGet @CommentCounter initCount <- MultiRWSS.mGet @CommentCounter
let let (((x, errs), debugs), commentCount) =
(((x, errs), debugs), commentCount) = runIdentity
runIdentity $ MultiRWSS.runMultiRWSTNil
$ MultiRWSS.runMultiRWSTNil $ MultiRWSS.withMultiStateAS initCount
$ MultiRWSS.withMultiStateAS initCount $ MultiRWSS.withMultiStateA (NodeAllocIndex 1)
$ MultiRWSS.withMultiStateA (NodeAllocIndex 1) $ MultiRWSS.withMultiReaders readers
$ MultiRWSS.withMultiReaders readers $ MultiRWSS.withMultiWriterAW
$ MultiRWSS.withMultiWriterAW $ MultiRWSS.withMultiWriterAW
$ MultiRWSS.withMultiWriterAW $ m
$ m
mTell debugs mTell debugs
mTell errs mTell errs
mSet commentCount mSet commentCount
pure (x, length errs) pure
( x
, sum
[ case e of
ErrorInput{} -> 1
ErrorUnusedComment{} -> 1
ErrorUnusedComments{} -> 1
ErrorMacroConfig{} -> 0
LayoutWarning{} -> 0
ErrorUnknownNode{} -> 1
ErrorOutputCheck{} -> 0
| e <- errs
]
)