summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index a87eae325..0839b3feb 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -1930,9 +1930,11 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
}
// try-catch-end is written in the folded wat format as
// (try
+ // (do
// ...
+ // )
// (catch
- // ...
+ // ...
// )
// )
// The parenthesis wrapping 'catch' is just a syntax and does not affect
@@ -1941,7 +1943,12 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> {
o << '(';
PrintExpressionContents(currFunction, o).visit(curr);
incIndent();
- maybePrintImplicitBlock(curr->body, false);
+ doIndent(o, indent);
+ o << "(do";
+ incIndent();
+ maybePrintImplicitBlock(curr->body, true);
+ decIndent();
+ o << "\n";
doIndent(o, indent);
o << "(catch";
incIndent();