Fix invalid syntax on nested do-block with comment

ghc92
Lennart Spitzner 2023-05-18 20:35:08 +02:00
parent 5ee0733f96
commit 3b431cdad2
2 changed files with 12 additions and 0 deletions

View File

@ -998,3 +998,13 @@ func = do
func False = 0
-- comment
func True = 1
#test nested do-block-with-comment issue
dofunc = do
do
some
code
do
-- abc
more
code

View File

@ -44,6 +44,8 @@ transformSimplifyIndent = Uniplate.rewrite $ \case
Just $ BDFlushCommentsPrior c (BDAddBaseY i x)
BDAddBaseY i (BDFlushCommentsPost c sm x) ->
Just $ BDFlushCommentsPost c sm (BDAddBaseY i x)
BDAddBaseY i (BDQueueComments comms x) ->
Just $ BDQueueComments comms (BDAddBaseY i x)
BDAddBaseY i (BDSeq l) ->
Just $ BDSeq $ List.init l ++ [BDAddBaseY i $ List.last l]
BDAddBaseY i (BDCols sig l) ->