File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
tools/zetasql-formatter/example_tests_formatted Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -50,16 +50,19 @@ std::string Unparse(const ASTNode* node) {
50
50
51
51
std::string UnparseWithComments (const ASTNode* node, std::deque<std::pair<std::string,
52
52
ParseLocationPoint>>& parse_tokens) {
53
- std::string unparsed_ ;
54
- parser::Unparser unparser (&unparsed_ );
53
+ std::string unparsed ;
54
+ parser::Unparser unparser (&unparsed );
55
55
// Print comments by visitors and pop.
56
56
node->Accept (&unparser, &parse_tokens);
57
57
// Emit left comments in parse_tokens.
58
58
for (const auto & parse_token : parse_tokens) {
59
59
unparser.print (parse_token.first );
60
60
}
61
61
unparser.FlushLine ();
62
- return unparsed_;
62
+ while (unparsed.back () == ' \n ' && unparsed.at (unparsed.size () - 2 ) == ' \n ' ) {
63
+ unparsed.pop_back ();
64
+ }
65
+ return unparsed;
63
66
}
64
67
65
68
namespace parser {
Original file line number Diff line number Diff line change 8
8
fuga
9
9
ON hoge .hoge = fuga .fuga ;
10
10
-- comment3
11
-
You can’t perform that action at this time.
0 commit comments