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

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: Status fixes Created 3 years, 9 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
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /// The messages in this file should follow the [Guide for Writing 5 /// The messages in this file should follow the [Guide for Writing
6 /// Diagnostics](../../../../front_end/lib/src/fasta/diagnostics.md). 6 /// Diagnostics](../../../../front_end/lib/src/fasta/diagnostics.md).
7 /// 7 ///
8 /// Other things to keep in mind: 8 /// Other things to keep in mind:
9 /// 9 ///
10 /// An INFO message should always be preceded by a non-INFO message, and the 10 /// An INFO message should always be preceded by a non-INFO message, and the
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, 237 JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS,
238 JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER, 238 JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
239 JS_INTEROP_INDEX_NOT_SUPPORTED, 239 JS_INTEROP_INDEX_NOT_SUPPORTED,
240 JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS, 240 JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS,
241 JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS, 241 JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
242 JS_PLACEHOLDER_CAPTURE, 242 JS_PLACEHOLDER_CAPTURE,
243 LIBRARY_NAME_MISMATCH, 243 LIBRARY_NAME_MISMATCH,
244 LIBRARY_NOT_FOUND, 244 LIBRARY_NOT_FOUND,
245 LIBRARY_NOT_SUPPORTED, 245 LIBRARY_NOT_SUPPORTED,
246 LIBRARY_TAG_MUST_BE_FIRST, 246 LIBRARY_TAG_MUST_BE_FIRST,
247 LIBRARY_URI_MISMATCH,
247 MAIN_HAS_PART_OF, 248 MAIN_HAS_PART_OF,
248 MAIN_NOT_A_FUNCTION, 249 MAIN_NOT_A_FUNCTION,
249 MAIN_WITH_EXTRA_PARAMETER, 250 MAIN_WITH_EXTRA_PARAMETER,
250 MALFORMED_STRING_LITERAL, 251 MALFORMED_STRING_LITERAL,
251 UNDEFINED_GETTER, 252 UNDEFINED_GETTER,
252 MEMBER_NOT_STATIC, 253 MEMBER_NOT_STATIC,
253 MEMBER_USES_CLASS_NAME, 254 MEMBER_USES_CLASS_NAME,
254 UNDEFINED_METHOD, 255 UNDEFINED_METHOD,
255 MINUS_OPERATOR_BAD_ARITY, 256 MINUS_OPERATOR_BAD_ARITY,
256 MIRROR_BLOAT, 257 MIRROR_BLOAT,
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 part 'part.dart'; 2023 part 'part.dart';
2023 2024
2024 main() {} 2025 main() {}
2025 """, 2026 """,
2026 'part.dart': """ 2027 'part.dart': """
2027 part of lib.bar; 2028 part of lib.bar;
2028 """ 2029 """
2029 } 2030 }
2030 ]), 2031 ]),
2031 2032
2033 MessageKind.LIBRARY_URI_MISMATCH: const MessageTemplate(
2034 MessageKind.LIBRARY_URI_MISMATCH,
2035 "Expected URI of library '#{libraryUri}'.",
2036 howToFix: "Try changing the directive to 'part of "
2037 "\"#{libraryUri}\";'.",
2038 examples: const [
2039 const {
2040 'main.dart': """
2041 library lib.foo;
2042
2043 part 'part.dart';
2044
2045 main() {}
2046 """,
2047 'part.dart': """
2048 part of 'not-main.dart';
2049 """
2050 }
2051 ]),
2052
2032 MessageKind.MISSING_LIBRARY_NAME: const MessageTemplate( 2053 MessageKind.MISSING_LIBRARY_NAME: const MessageTemplate(
2033 MessageKind.MISSING_LIBRARY_NAME, 2054 MessageKind.MISSING_LIBRARY_NAME,
2034 "Library has no name. Part directive expected library name " 2055 "Library has no name. Part directive expected library name "
2035 "to be '#{libraryName}'.", 2056 "to be '#{libraryName}'.",
2036 howToFix: "Try adding 'library #{libraryName};' to the library.", 2057 howToFix: "Try adding 'library #{libraryName};' to the library.",
2037 examples: const [ 2058 examples: const [
2038 const { 2059 const {
2039 'main.dart': """ 2060 'main.dart': """
2040 part 'part.dart'; 2061 part 'part.dart';
2041 2062
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
3770 static String convertToString(value) { 3791 static String convertToString(value) {
3771 if (value is ErrorToken) { 3792 if (value is ErrorToken) {
3772 // Shouldn't happen. 3793 // Shouldn't happen.
3773 return value.assertionMessage; 3794 return value.assertionMessage;
3774 } else if (value is Token) { 3795 } else if (value is Token) {
3775 value = value.lexeme; 3796 value = value.lexeme;
3776 } 3797 }
3777 return '$value'; 3798 return '$value';
3778 } 3799 }
3779 } 3800 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/task/dart_test.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698