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

Unified Diff: tools/gn/parser.cc

Issue 1268973003: Enhance GN string interpolation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments fixed Created 5 years, 4 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 | « no previous file | tools/gn/string_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/parser.cc
diff --git a/tools/gn/parser.cc b/tools/gn/parser.cc
index c207ce7179ec72474ad20603d0e8ab929b7f0793..286409b5ed48a6d3b207a37c37ddfe306af313fb 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -56,10 +56,13 @@ const char kGrammar_Help[] =
" A string literal represents a string value consisting of the quoted\n"
" characters with possible escape sequences and variable expansions.\n"
"\n"
- " string = `\"` { char | escape | expansion } `\"` .\n"
- " escape = `\\` ( \"$\" | `\"` | char ) .\n"
- " expansion = \"$\" ( identifier | \"{\" identifier \"}\" ) .\n"
- " char = /* any character except \"$\", `\"`, or newline */ .\n"
+ " string = `\"` { char | escape | expansion } `\"` .\n"
+ " escape = `\\` ( \"$\" | `\"` | char ) .\n"
+ " BracketExpansion = \"{\" ( identifier | ArrayAccess | ScopeAccess "
+ ") \"}\" .\n"
+ " expansion = \"$\" ( identifier | BracketExpansion ) .\n"
+ " char = /* any character except \"$\", `\"`, or newline "
+ "*/ .\n"
"\n"
" After a backslash, certain sequences represent special characters:\n"
"\n"
@@ -92,11 +95,12 @@ const char kGrammar_Help[] =
" Block = \"{\" StatementList \"}\" .\n"
" StatementList = { Statement } .\n"
"\n"
+ " ArrayAccess = identifier \"[\" { identifier | integer } \"]\" .\n"
+ " ScopeAccess = identifier \".\" identifier .\n"
" Expr = UnaryExpr | Expr BinaryOp Expr .\n"
" UnaryExpr = PrimaryExpr | UnaryOp UnaryExpr .\n"
" PrimaryExpr = identifier | integer | string | Call\n"
- " | identifier \"[\" Expr \"]\"\n"
- " | identifier \".\" identifier\n"
+ " | ArrayAccess | ScopeAccess\n"
" | \"(\" Expr \")\"\n"
" | \"[\" [ ExprList [ \",\" ] ] \"]\" .\n"
" ExprList = Expr { \",\" Expr } .\n"
« no previous file with comments | « no previous file | tools/gn/string_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698