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

Unified Diff: tools/gn/parser.h

Issue 588893006: gn: attach comments to parse tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: x64 Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/parse_tree_unittest.cc ('k') | tools/gn/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/parser.h
diff --git a/tools/gn/parser.h b/tools/gn/parser.h
index 407b472081cbd052f55c88d88f2d5907f61d4acb..a82f1c09a00c511b5ea7903d6d23551a09bd203a 100644
--- a/tools/gn/parser.h
+++ b/tools/gn/parser.h
@@ -73,6 +73,14 @@ class Parser {
scoped_ptr<BlockNode> ParseBlock();
scoped_ptr<ParseNode> ParseCondition();
+ // Generates a pre- and post-order traversal of the tree.
+ void TraverseOrder(const ParseNode* root,
+ std::vector<const ParseNode*>* pre,
+ std::vector<const ParseNode*>* post);
+
+ // Attach comments to nearby syntax.
+ void AssignComments(ParseNode* file);
+
bool IsAssignment(const ParseNode* node) const;
bool IsStatementBreak(Token::Type token_type) const;
@@ -90,7 +98,9 @@ class Parser {
bool at_end() const { return cur_ >= tokens_.size(); }
bool has_error() const { return err_->has_error(); }
- const std::vector<Token>& tokens_;
+ std::vector<Token> tokens_;
+ std::vector<Token> line_comment_tokens_;
+ std::vector<Token> suffix_comment_tokens_;
static ParserHelper expressions_[Token::NUM_TYPES];
« no previous file with comments | « tools/gn/parse_tree_unittest.cc ('k') | tools/gn/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698