@@ -705,16 +705,14 @@ and printModuleBinding ~state ~isRec moduleBinding cmtTbl i =
705
705
in
706
706
let modExprDoc, modConstraintDoc =
707
707
match moduleBinding.pmb_expr with
708
- | {pmod_desc = Pmod_constraint (modExpr , modType )} ->
708
+ | {pmod_desc = Pmod_constraint (modExpr, modType)}
709
+ when not
710
+ (ParsetreeViewer. hasAwaitAttribute
711
+ moduleBinding.pmb_expr.pmod_attributes) ->
709
712
( printModExpr ~state modExpr cmtTbl,
710
713
Doc. concat [Doc. text " : " ; printModType ~state modType cmtTbl] )
711
714
| modExpr -> (printModExpr ~state modExpr cmtTbl, Doc. nil)
712
715
in
713
- let modExprDoc =
714
- if ParsetreeViewer. hasAwaitAttribute moduleBinding.pmb_expr.pmod_attributes
715
- then Doc. concat [Doc. text " await " ; modExprDoc]
716
- else modExprDoc
717
- in
718
716
let modName =
719
717
let doc = Doc. text moduleBinding.pmb_name.Location. txt in
720
718
printComments doc cmtTbl moduleBinding.pmb_name.loc
@@ -4967,11 +4965,13 @@ and printExpressionBlock ~state ~braces expr cmtTbl =
4967
4965
in
4968
4966
let name, modExpr =
4969
4967
match modExpr.pmod_desc with
4970
- | Pmod_constraint (modExpr , modType ) ->
4968
+ | Pmod_constraint (modExpr2, modType)
4969
+ when not (ParsetreeViewer. hasAwaitAttribute modExpr.pmod_attributes)
4970
+ ->
4971
4971
let name =
4972
4972
Doc. concat [name; Doc. text " : " ; printModType ~state modType cmtTbl]
4973
4973
in
4974
- (name, modExpr )
4974
+ (name, modExpr2 )
4975
4975
| _ -> (name, modExpr)
4976
4976
in
4977
4977
let letModuleDoc =
@@ -5455,6 +5455,14 @@ and printModExpr ~state modExpr cmtTbl =
5455
5455
]
5456
5456
| Pmod_functor _ -> printModFunctor ~state modExpr cmtTbl
5457
5457
in
5458
+ let doc =
5459
+ if ParsetreeViewer. hasAwaitAttribute modExpr.pmod_attributes then
5460
+ match modExpr.pmod_desc with
5461
+ | Pmod_constraint _ ->
5462
+ Doc. concat [Doc. text " await " ; Doc. lparen; doc; Doc. rparen]
5463
+ | _ -> Doc. concat [Doc. text " await " ; doc]
5464
+ else doc
5465
+ in
5458
5466
printComments doc cmtTbl modExpr.pmod_loc
5459
5467
5460
5468
and printModFunctor ~state modExpr cmtTbl =
0 commit comments