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

Unified Diff: tools/gn/parser.h

Issue 1048913003: tools/gn: don't allow trailing junk or non-literals in "value" conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang-format Created 5 years, 9 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/input_conversion_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 ce24e0dffd8f54cdc1661abafdd3f4b6e4013bc2..3348e2d225505033af347634c9befbd73d8f416e 100644
--- a/tools/gn/parser.h
+++ b/tools/gn/parser.h
@@ -40,13 +40,17 @@ class Parser {
static scoped_ptr<ParseNode> ParseExpression(const std::vector<Token>& tokens,
Err* err);
- scoped_ptr<ParseNode> ParseExpression();
+ // Alternative to parsing that assumes the input is a literal value.
+ static scoped_ptr<ParseNode> ParseValue(const std::vector<Token>& tokens,
+ Err* err);
private:
// Vector must be valid for lifetime of call.
Parser(const std::vector<Token>& tokens, Err* err);
~Parser();
+ scoped_ptr<ParseNode> ParseExpression();
+
// Parses an expression with the given precedence or higher.
scoped_ptr<ParseNode> ParseExpression(int precedence);
« no previous file with comments | « tools/gn/input_conversion_unittest.cc ('k') | tools/gn/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698