Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: tools/gn/parse_tree.h

Issue 595753002: gn: handle continued suffix comments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-append-comment
Patch Set: only continue if at same column Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/gn/parse_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef TOOLS_GN_PARSE_TREE_H_ 5 #ifndef TOOLS_GN_PARSE_TREE_H_
6 #define TOOLS_GN_PARSE_TREE_H_ 6 #define TOOLS_GN_PARSE_TREE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 21 matching lines...) Expand all
32 32
33 const std::vector<Token>& before() const { return before_; } 33 const std::vector<Token>& before() const { return before_; }
34 void append_before(Token c) { 34 void append_before(Token c) {
35 before_.push_back(c); 35 before_.push_back(c);
36 } 36 }
37 37
38 const std::vector<Token>& suffix() const { return suffix_; } 38 const std::vector<Token>& suffix() const { return suffix_; }
39 void append_suffix(Token c) { 39 void append_suffix(Token c) {
40 suffix_.push_back(c); 40 suffix_.push_back(c);
41 } 41 }
42 // Reverse the order of the suffix comments. When walking the tree in
43 // post-order we append suffix comments in reverse order, so this fixes them
44 // up.
45 void ReverseSuffix();
42 46
43 const std::vector<Token>& after() const { return after_; } 47 const std::vector<Token>& after() const { return after_; }
44 void append_after(Token c) { 48 void append_after(Token c) {
45 after_.push_back(c); 49 after_.push_back(c);
46 } 50 }
47 51
48 private: 52 private:
49 // Whole line comments before the expression. 53 // Whole line comments before the expression.
50 std::vector<Token> before_; 54 std::vector<Token> before_;
51 55
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 432 }
429 433
430 private: 434 private:
431 Token op_; 435 Token op_;
432 scoped_ptr<ParseNode> operand_; 436 scoped_ptr<ParseNode> operand_;
433 437
434 DISALLOW_COPY_AND_ASSIGN(UnaryOpNode); 438 DISALLOW_COPY_AND_ASSIGN(UnaryOpNode);
435 }; 439 };
436 440
437 #endif // TOOLS_GN_PARSE_TREE_H_ 441 #endif // TOOLS_GN_PARSE_TREE_H_
OLDNEW
« no previous file with comments | « no previous file | tools/gn/parse_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698