Skip to content

Commit de87f41

Browse files
committed
print await for mod expr
1 parent ddad187 commit de87f41

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

jscomp/syntax/src/res_printer.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,6 @@ and printModuleBinding ~state ~isRec moduleBinding cmtTbl i =
710710
Doc.concat [Doc.text ": "; printModType ~state modType cmtTbl] )
711711
| modExpr -> (printModExpr ~state modExpr cmtTbl, Doc.nil)
712712
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
718713
let modName =
719714
let doc = Doc.text moduleBinding.pmb_name.Location.txt in
720715
printComments doc cmtTbl moduleBinding.pmb_name.loc
@@ -5455,6 +5450,11 @@ and printModExpr ~state modExpr cmtTbl =
54555450
]
54565451
| Pmod_functor _ -> printModFunctor ~state modExpr cmtTbl
54575452
in
5453+
let doc =
5454+
if ParsetreeViewer.hasAwaitAttribute modExpr.pmod_attributes then
5455+
Doc.concat [Doc.text "await "; doc]
5456+
else doc
5457+
in
54585458
printComments doc cmtTbl modExpr.pmod_loc
54595459

54605460
and printModFunctor ~state modExpr cmtTbl =

jscomp/syntax/tests/printer/expr/expected/letmodule.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ let x = {
44
}
55

66
let x = {
7-
module M = ME
7+
module M = await ME
88
M.x
99
}

0 commit comments

Comments
 (0)