From 26c5077f88d453fb4bd8f4a60d94f51db45f677e Mon Sep 17 00:00:00 2001 From: Paul Taykalo Date: Sat, 30 Sep 2017 22:49:32 +0300 Subject: [PATCH] Fix AST dump generation for enum_is_case_expr AST Dumper at the moment generates invalid AST dump output for `enum_is_case_expr` Currently it `forgets` to add a closing bracket, which leads to unparsable AST dump output. ``` (if_stmt implicit\ (call_expr implicit type='Int1' nothrow arg_labels=\ (dot_syntax_call_expr implicit type='() -> Int1' nothrow\ (declref_expr implicit type='(Bool) -> () -> Int1' decl=Swift.(file).Bool._getBuiltinLogicValue() function_ref=double)\ (enum_is_case_expr implicit type='Bool' some\ (declref_expr implicit type='UIBarButtonItem?' decl=The.(file).Controller..tmp1 direct_to_storage function_ref=unapplied))\ # <--- One Bracked is missing here (tuple_expr implicit type='()'))\ (return_stmt implicit\ (force_value_expr implicit type='UIBarButtonItem'\ (declref_expr implicit type='UIBarButtonItem?' decl=The.(file).Controller..tmp1 direct_to_storage function_ref=unapplied))))\ ``` --- lib/AST/ASTDumper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index a3f433f448ab2..295c39dc36de9 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -2343,7 +2343,7 @@ class PrintExpr : public ExprVisitor { printCommon(E, "enum_is_case_expr") << ' ' << E->getEnumElement()->getName() << "\n"; printRec(E->getSubExpr()); - + PrintWithColorRAII(OS, ParenthesisColor) << ')'; } void visitUnresolvedPatternExpr(UnresolvedPatternExpr *E) { printCommon(E, "unresolved_pattern_expr") << '\n';