From e2f3af250ee3e79a52fdffe80fd42a398d2a2d89 Mon Sep 17 00:00:00 2001 From: Matts966 Date: Mon, 25 Apr 2022 04:15:52 +0900 Subject: [PATCH] Fix redundant newline --- zetasql/parser/unparser.cc | 9 ++++++--- .../example_tests_formatted/missing_comment.sql | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zetasql/parser/unparser.cc b/zetasql/parser/unparser.cc index 7069872bf..e06ecdb40 100644 --- a/zetasql/parser/unparser.cc +++ b/zetasql/parser/unparser.cc @@ -50,8 +50,8 @@ std::string Unparse(const ASTNode* node) { std::string UnparseWithComments(const ASTNode* node, std::deque>& parse_tokens) { - std::string unparsed_; - parser::Unparser unparser(&unparsed_); + std::string unparsed; + parser::Unparser unparser(&unparsed); // Print comments by visitors and pop. node->Accept(&unparser, &parse_tokens); // Emit left comments in parse_tokens. @@ -59,7 +59,10 @@ std::string UnparseWithComments(const ASTNode* node, std::deque