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

Side by Side Diff: tools/gn/parser.cc

Issue 1038233002: tools/gn: disallow non-canonical integer literals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move kBad tests down by usage Created 5 years, 8 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 | « tools/gn/parse_tree_unittest.cc ('k') | no next file » | 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 #include "tools/gn/parser.h" 5 #include "tools/gn/parser.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "tools/gn/functions.h" 8 #include "tools/gn/functions.h"
9 #include "tools/gn/operators.h" 9 #include "tools/gn/operators.h"
10 #include "tools/gn/token.h" 10 #include "tools/gn/token.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 " identifiers:\n" 42 " identifiers:\n"
43 "\n" 43 "\n"
44 " else false if true\n" 44 " else false if true\n"
45 "\n" 45 "\n"
46 "Integer literals\n" 46 "Integer literals\n"
47 "\n" 47 "\n"
48 " An integer literal represents a decimal integer value.\n" 48 " An integer literal represents a decimal integer value.\n"
49 "\n" 49 "\n"
50 " integer = [ \"-\" ] digit { digit } .\n" 50 " integer = [ \"-\" ] digit { digit } .\n"
51 "\n" 51 "\n"
52 " Leading zeros and negative zero are disallowed.\n"
53 "\n"
52 "String literals\n" 54 "String literals\n"
53 "\n" 55 "\n"
54 " A string literal represents a string value consisting of the quoted\n" 56 " A string literal represents a string value consisting of the quoted\n"
55 " characters with possible escape sequences and variable expansions.\n" 57 " characters with possible escape sequences and variable expansions.\n"
56 "\n" 58 "\n"
57 " string = `\"` { char | escape | expansion } `\"` .\n" 59 " string = `\"` { char | escape | expansion } `\"` .\n"
58 " escape = `\\` ( \"$\" | `\"` | char ) .\n" 60 " escape = `\\` ( \"$\" | `\"` | char ) .\n"
59 " expansion = \"$\" ( identifier | \"{\" identifier \"}\" ) .\n" 61 " expansion = \"$\" ( identifier | \"{\" identifier \"}\" ) .\n"
60 " char = /* any character except \"$\", `\"`, or newline */ .\n" 62 " char = /* any character except \"$\", `\"`, or newline */ .\n"
61 "\n" 63 "\n"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 break; 709 break;
708 } 710 }
709 } 711 }
710 712
711 // Suffix comments were assigned in reverse, so if there were multiple on 713 // Suffix comments were assigned in reverse, so if there were multiple on
712 // the same node, they need to be reversed. 714 // the same node, they need to be reversed.
713 if ((*i)->comments() && !(*i)->comments()->suffix().empty()) 715 if ((*i)->comments() && !(*i)->comments()->suffix().empty())
714 const_cast<ParseNode*>(*i)->comments_mutable()->ReverseSuffix(); 716 const_cast<ParseNode*>(*i)->comments_mutable()->ReverseSuffix();
715 } 717 }
716 } 718 }
OLDNEW
« no previous file with comments | « tools/gn/parse_tree_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698