Chromium Code Reviews| Index: lib/src/utils.dart |
| diff --git a/lib/src/utils.dart b/lib/src/utils.dart |
| index 7fb513dcaa9a68fca2312e1a870db8cf86203680..ac031d9cc90f152468f7bec918d315abc1fa3876 100644 |
| --- a/lib/src/utils.dart |
| +++ b/lib/src/utils.dart |
| @@ -22,12 +22,20 @@ export 'asset/dart/utils.dart'; |
| /// A regular expression matching a Dart identifier. |
| /// |
| /// This also matches a package name, since they must be Dart identifiers. |
| -final identifierRegExp = new RegExp(r"[a-zA-Z_][a-zA-Z0-9_]+"); |
| +final identifierRegExp = new RegExp(r"[a-zA-Z_][a-zA-Z0-9_]*"); |
|
Bob Nystrom
2015/12/01 23:21:15
"\w+" or "[a-zA-Z_]\w*"
?
nweiz
2015/12/02 00:29:01
Done.
|
| /// Like [identifierRegExp], but anchored so that it only matches strings that |
| /// are *just* Dart identifiers. |
| final onlyIdentifierRegExp = new RegExp("^${identifierRegExp.pattern}\$"); |
| +/// Dart reserved words, from the Dart spec. |
| +const reservedWords = const [ |
| + "assert", "break", "case", "catch", "class", "const", "continue", "default", |
| + "do", "else", "extends", "false", "final", "finally", "for", "if", "in", "is", |
| + "new", "null", "return", "super", "switch", "this", "throw", "true", "try", |
| + "var", "void", "while", "with" |
| +]; |
| + |
| /// A pair of values. |
| class Pair<E, F> { |
| E first; |