| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library name_validator; | 5 library name_validator; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import '../../../pkg/path/lib/path.dart' as path; |
| 9 import '../entrypoint.dart'; | 10 import '../entrypoint.dart'; |
| 10 import '../io.dart'; | 11 import '../io.dart'; |
| 11 import '../path.dart' as path; | |
| 12 import '../validator.dart'; | 12 import '../validator.dart'; |
| 13 | 13 |
| 14 /// Dart reserved words, from the Dart spec. | 14 /// Dart reserved words, from the Dart spec. |
| 15 final _RESERVED_WORDS = [ | 15 final _RESERVED_WORDS = [ |
| 16 "abstract", "as", "dynamic", "export", "external", "factory", "get", | 16 "abstract", "as", "dynamic", "export", "external", "factory", "get", |
| 17 "implements", "import", "library", "operator", "part", "set", "static", | 17 "implements", "import", "library", "operator", "part", "set", "static", |
| 18 "typedef" | 18 "typedef" |
| 19 ]; | 19 ]; |
| 20 | 20 |
| 21 /// A validator that validates the name of the package and its libraries. | 21 /// A validator that validates the name of the package and its libraries. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 builder | 84 builder |
| 85 ..add(source.substring(lastMatchEnd, match.start + 1)) | 85 ..add(source.substring(lastMatchEnd, match.start + 1)) |
| 86 ..add("_") | 86 ..add("_") |
| 87 ..add(match.group(1).toLowerCase()); | 87 ..add(match.group(1).toLowerCase()); |
| 88 lastMatchEnd = match.end; | 88 lastMatchEnd = match.end; |
| 89 } | 89 } |
| 90 builder.add(source.substring(lastMatchEnd)); | 90 builder.add(source.substring(lastMatchEnd)); |
| 91 return builder.toString().toLowerCase(); | 91 return builder.toString().toLowerCase(); |
| 92 } | 92 } |
| 93 } | 93 } |
| OLD | NEW |