Fix handling of EOF
parent
1ad34aedcc
commit
8290109e7f
|
@ -313,7 +313,7 @@ parsePrintModule configWithDebugs inputText = runExceptT $ do
|
||||||
True -> not $ null errsWarns
|
True -> not $ null errsWarns
|
||||||
if hasErrors
|
if hasErrors
|
||||||
then throwE $ errsWarns
|
then throwE $ errsWarns
|
||||||
else pure $ TextL.toStrict $ TextL.snoc outputTextL '\n'
|
else pure $ TextL.toStrict outputTextL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ parsePrintModuleTests conf filename input = do
|
||||||
else lift
|
else lift
|
||||||
$ pPrintModuleAndCheck moduleConf perItemConf anns parsedModule
|
$ pPrintModuleAndCheck moduleConf perItemConf anns parsedModule
|
||||||
if null errs
|
if null errs
|
||||||
then pure $ TextL.toStrict $ TextL.snoc ltext '\n'
|
then pure $ TextL.toStrict ltext
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
errStrs = errs <&> \case
|
errStrs = errs <&> \case
|
||||||
|
@ -497,7 +497,7 @@ ppModule lmod@(L _loc _m@(HsModule _ _name _exports _ decls _ _)) = do
|
||||||
(ExactPrint.AnnComment (ExactPrint.Comment cmStr _ _), l) -> do
|
(ExactPrint.AnnComment (ExactPrint.Comment cmStr _ _), l) -> do
|
||||||
ppmMoveToExactLoc l
|
ppmMoveToExactLoc l
|
||||||
mTell $ Text.Builder.fromString cmStr
|
mTell $ Text.Builder.fromString cmStr
|
||||||
(ExactPrint.G _, (ExactPrint.DP (eofZ, eofX))) ->
|
(ExactPrint.AnnEofPos, (ExactPrint.DP (eofZ, eofX))) ->
|
||||||
let folder (acc, _) (kw, ExactPrint.DP (y, x)) = case kw of
|
let folder (acc, _) (kw, ExactPrint.DP (y, x)) = case kw of
|
||||||
ExactPrint.AnnComment cm
|
ExactPrint.AnnComment cm
|
||||||
| span <- ExactPrint.commentIdentifier cm
|
| span <- ExactPrint.commentIdentifier cm
|
||||||
|
|
Loading…
Reference in New Issue