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

Side by Side Diff: dart/pkg/compiler/lib/src/warnings.dart

Issue 811583004: Recover from incorrectly ordered library tags. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « dart/pkg/compiler/lib/src/library_loader.dart ('k') | no next file » | 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 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!"; 7 const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 static const MessageKind DART_EXT_NOT_SUPPORTED = const MessageKind( 2171 static const MessageKind DART_EXT_NOT_SUPPORTED = const MessageKind(
2172 "The 'dart-ext' scheme is not supported.", 2172 "The 'dart-ext' scheme is not supported.",
2173 howToFix: "Try analyzing the code with the --allow-native-extensions " 2173 howToFix: "Try analyzing the code with the --allow-native-extensions "
2174 "option.", 2174 "option.",
2175 examples: const [""" 2175 examples: const ["""
2176 import 'dart-ext:main'; 2176 import 'dart-ext:main';
2177 2177
2178 main() {} 2178 main() {}
2179 """]); 2179 """]);
2180 2180
2181 static const MessageKind LIBRARY_TAG_MUST_BE_FIRST = const MessageKind(
ahe 2014/12/16 14:45:51 Luke: Any comments regarding these error messages?
2182 "Library declaration should come before other declartions.",
lukechurch 2014/12/16 15:18:16 The library dec.....
ahe 2014/12/16 15:27:17 Done.
2183 howToFix: "Try moving the declaration to the top of the file.",
2184 examples: const [
2185 """
2186 import 'dart:core';
2187 library foo;
2188 main() {}
2189 """,
2190 ]);
2191
2192 static const MessageKind ONLY_ONE_LIBRARY_TAG = const MessageKind(
2193 "There can only be one library declaration.",
2194 howToFix: "Try removing all but the first library declaration.",
2195 examples: const [
lukechurch 2014/12/16 15:18:16 s/'all but the first library '/'all other library
ahe 2014/12/16 15:27:17 Done.
2196 """
2197 library foo;
2198 library bar;
2199 main() {}
2200 """,
2201 ]);
2202
2203 static const MessageKind IMPORT_BEFORE_PARTS = const MessageKind(
2204 "Import declarations must come before parts.",
lukechurch 2014/12/16 15:18:16 Is there a reason for the inconsistency between sh
ahe 2014/12/16 15:27:17 I used "should" because I felt that sounded less h
2205 howToFix: "Try moving this import further up in the file.",
2206 examples: const [
2207 const <String, String>{
2208 'main.dart': """
2209 library test.main;
2210 part 'part.dart';
2211 import 'dart:core';
2212 main() {}
2213 """,
2214 'part.dart': """
2215 part of test.main;
2216 """,
2217 }]);
2218
2219 static const MessageKind EXPORT_BEFORE_PARTS = const MessageKind(
2220 "Export declarations must come before parts.",
2221 howToFix: "Try moving this export further up in the file.",
2222 examples: const [
2223 const <String, String>{
2224 'main.dart': """
2225 library test.main;
2226 part 'part.dart';
2227 export 'dart:core';
2228 main() {}
2229 """,
2230 'part.dart': """
2231 part of test.main;
2232 """,
2233 }]);
2234
2181 ////////////////////////////////////////////////////////////////////////////// 2235 //////////////////////////////////////////////////////////////////////////////
2182 // Patch errors start. 2236 // Patch errors start.
2183 ////////////////////////////////////////////////////////////////////////////// 2237 //////////////////////////////////////////////////////////////////////////////
2184 2238
2185 static const MessageKind PATCH_RETURN_TYPE_MISMATCH = const MessageKind( 2239 static const MessageKind PATCH_RETURN_TYPE_MISMATCH = const MessageKind(
2186 "Patch return type '#{patchReturnType}' does not match " 2240 "Patch return type '#{patchReturnType}' does not match "
2187 "'#{originReturnType}' on origin method '#{methodName}'."); 2241 "'#{originReturnType}' on origin method '#{methodName}'.");
2188 2242
2189 static const MessageKind PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH = 2243 static const MessageKind PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH =
2190 const MessageKind( 2244 const MessageKind(
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
2367 static String convertToString(value) { 2421 static String convertToString(value) {
2368 if (value is ErrorToken) { 2422 if (value is ErrorToken) {
2369 // Shouldn't happen. 2423 // Shouldn't happen.
2370 return value.assertionMessage; 2424 return value.assertionMessage;
2371 } else if (value is Token) { 2425 } else if (value is Token) {
2372 value = value.value; 2426 value = value.value;
2373 } 2427 }
2374 return '$value'; 2428 return '$value';
2375 } 2429 }
2376 } 2430 }
OLDNEW
« no previous file with comments | « dart/pkg/compiler/lib/src/library_loader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698