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

Side by Side Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 2640853005: Make Analyzer, VM and dart2js accept URI strings as part-of library identifier. (Closed)
Patch Set: Add tests, enable flag by default in analyzer. Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * The messages in this file should meet the following guide lines: 6 * The messages in this file should meet the following guide lines:
7 * 7 *
8 * 1. The message should be a complete sentence starting with an uppercase 8 * 1. The message should be a complete sentence starting with an uppercase
9 * letter, and ending with a period. 9 * letter, and ending with a period.
10 * 10 *
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, 284 JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS,
285 JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER, 285 JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
286 JS_INTEROP_INDEX_NOT_SUPPORTED, 286 JS_INTEROP_INDEX_NOT_SUPPORTED,
287 JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS, 287 JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS,
288 JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS, 288 JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
289 JS_PLACEHOLDER_CAPTURE, 289 JS_PLACEHOLDER_CAPTURE,
290 LIBRARY_NAME_MISMATCH, 290 LIBRARY_NAME_MISMATCH,
291 LIBRARY_NOT_FOUND, 291 LIBRARY_NOT_FOUND,
292 LIBRARY_NOT_SUPPORTED, 292 LIBRARY_NOT_SUPPORTED,
293 LIBRARY_TAG_MUST_BE_FIRST, 293 LIBRARY_TAG_MUST_BE_FIRST,
294 LIBRARY_URI_MISMATCH,
294 MAIN_HAS_PART_OF, 295 MAIN_HAS_PART_OF,
295 MAIN_NOT_A_FUNCTION, 296 MAIN_NOT_A_FUNCTION,
296 MAIN_WITH_EXTRA_PARAMETER, 297 MAIN_WITH_EXTRA_PARAMETER,
297 MALFORMED_STRING_LITERAL, 298 MALFORMED_STRING_LITERAL,
298 UNDEFINED_GETTER, 299 UNDEFINED_GETTER,
299 MEMBER_NOT_STATIC, 300 MEMBER_NOT_STATIC,
300 MEMBER_USES_CLASS_NAME, 301 MEMBER_USES_CLASS_NAME,
301 UNDEFINED_METHOD, 302 UNDEFINED_METHOD,
302 MINUS_OPERATOR_BAD_ARITY, 303 MINUS_OPERATOR_BAD_ARITY,
303 MIRROR_BLOAT, 304 MIRROR_BLOAT,
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 part 'part.dart'; 2070 part 'part.dart';
2070 2071
2071 main() {} 2072 main() {}
2072 """, 2073 """,
2073 'part.dart': """ 2074 'part.dart': """
2074 part of lib.bar; 2075 part of lib.bar;
2075 """ 2076 """
2076 } 2077 }
2077 ]), 2078 ]),
2078 2079
2080 MessageKind.LIBRARY_URI_MISMATCH: const MessageTemplate(
2081 MessageKind.LIBRARY_URI_MISMATCH,
2082 "Expected URI of library '#{libraryUri}'.",
2083 howToFix: "Try changing the directive to 'part of "
2084 "\"#{libraryUri}\";'.",
2085 examples: const [
2086 const {
2087 'main.dart': """
2088 library lib.foo;
2089
2090 part 'part.dart';
2091
2092 main() {}
2093 """,
2094 'part.dart': """
2095 part of "main.dart";
2096 """
2097 }
2098 ]),
2099
2079 MessageKind.MISSING_LIBRARY_NAME: const MessageTemplate( 2100 MessageKind.MISSING_LIBRARY_NAME: const MessageTemplate(
2080 MessageKind.MISSING_LIBRARY_NAME, 2101 MessageKind.MISSING_LIBRARY_NAME,
2081 "Library has no name. Part directive expected library name " 2102 "Library has no name. Part directive expected library name "
2082 "to be '#{libraryName}'.", 2103 "to be '#{libraryName}'.",
2083 howToFix: "Try adding 'library #{libraryName};' to the library.", 2104 howToFix: "Try adding 'library #{libraryName};' to the library.",
2084 examples: const [ 2105 examples: const [
2085 const { 2106 const {
2086 'main.dart': """ 2107 'main.dart': """
2087 part 'part.dart'; 2108 part 'part.dart';
2088 2109
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
3805 static String convertToString(value) { 3826 static String convertToString(value) {
3806 if (value is ErrorToken) { 3827 if (value is ErrorToken) {
3807 // Shouldn't happen. 3828 // Shouldn't happen.
3808 return value.assertionMessage; 3829 return value.assertionMessage;
3809 } else if (value is Token) { 3830 } else if (value is Token) {
3810 value = value.value; 3831 value = value.value;
3811 } 3832 }
3812 return '$value'; 3833 return '$value';
3813 } 3834 }
3814 } 3835 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698