| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |