| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart._internal; | 5 part of dart._internal; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Implementation of [core.Symbol]. This class uses the same name as | 8 * Implementation of [core.Symbol]. This class uses the same name as |
| 9 * a core class so a user can't tell the difference. | 9 * a core class so a user can't tell the difference. |
| 10 * | 10 * |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 * | 38 * |
| 39 * It matches identifiers but not reserved words. The identifiers | 39 * It matches identifiers but not reserved words. The identifiers |
| 40 * may start with '_'. | 40 * may start with '_'. |
| 41 */ | 41 */ |
| 42 static const String identifierRE = | 42 static const String identifierRE = |
| 43 r'(?!' '$reservedWordRE' r'\b(?!\$))[a-zA-Z$_][\w$]*'; | 43 r'(?!' '$reservedWordRE' r'\b(?!\$))[a-zA-Z$_][\w$]*'; |
| 44 /** | 44 /** |
| 45 * Source of RegExp matching a declarable operator names. | 45 * Source of RegExp matching a declarable operator names. |
| 46 * | 46 * |
| 47 * The operators that can be declared using `operator` declarations are | 47 * The operators that can be declared using `operator` declarations are |
| 48 * also the only ones allowed as symbols. The name of the oeprators is | 48 * also the only ones allowed as symbols. The name of the operators is |
| 49 * the same as the operator itself except for unary minus, where the name | 49 * the same as the operator itself except for unary minus, where the name |
| 50 * is "unary-". | 50 * is "unary-". |
| 51 */ | 51 */ |
| 52 static const String operatorRE = | 52 static const String operatorRE = |
| 53 r'(?:[\-+*/%&|^]|\[\]=?|==|~/?|<[<=]?|>[>=]?|unary-)'; | 53 r'(?:[\-+*/%&|^]|\[\]=?|==|~/?|<[<=]?|>[>=]?|unary-)'; |
| 54 | 54 |
| 55 // Grammar if symbols: | 55 // Grammar if symbols: |
| 56 // symbol ::= qualifiedName | <empty> | 56 // symbol ::= qualifiedName | <empty> |
| 57 // qualifiedName ::= publicIdentifier '.' qualifiedName | name | 57 // qualifiedName ::= publicIdentifier '.' qualifiedName | name |
| 58 // name ::= publicIdentifier | 58 // name ::= publicIdentifier |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * Checks whether name is a valid symbol name. | 135 * Checks whether name is a valid symbol name. |
| 136 * | 136 * |
| 137 * This test allows both private and non-private symbols. | 137 * This test allows both private and non-private symbols. |
| 138 */ | 138 */ |
| 139 static bool isValidSymbol(String name) { | 139 static bool isValidSymbol(String name) { |
| 140 return (name.isEmpty || symbolPattern.hasMatch(name)); | 140 return (name.isEmpty || symbolPattern.hasMatch(name)); |
| 141 } | 141 } |
| 142 } | 142 } |
| OLD | NEW |