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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/pkg/compiler/lib/src/library_loader.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/lib/src/warnings.dart
diff --git a/dart/pkg/compiler/lib/src/warnings.dart b/dart/pkg/compiler/lib/src/warnings.dart
index f3e7cc16ccd9e51385463062d94db3271a75028f..76755b627234a476d43d0152a8d734e41e094853 100644
--- a/dart/pkg/compiler/lib/src/warnings.dart
+++ b/dart/pkg/compiler/lib/src/warnings.dart
@@ -2178,6 +2178,60 @@ import 'dart-ext:main';
main() {}
"""]);
+ static const MessageKind LIBRARY_TAG_MUST_BE_FIRST = const MessageKind(
ahe 2014/12/16 14:45:51 Luke: Any comments regarding these error messages?
+ "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.
+ howToFix: "Try moving the declaration to the top of the file.",
+ examples: const [
+"""
+import 'dart:core';
+library foo;
+main() {}
+""",
+ ]);
+
+ static const MessageKind ONLY_ONE_LIBRARY_TAG = const MessageKind(
+ "There can only be one library declaration.",
+ howToFix: "Try removing all but the first library declaration.",
+ 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.
+"""
+library foo;
+library bar;
+main() {}
+""",
+ ]);
+
+ static const MessageKind IMPORT_BEFORE_PARTS = const MessageKind(
+ "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
+ howToFix: "Try moving this import further up in the file.",
+ examples: const [
+ const <String, String>{
+ 'main.dart': """
+library test.main;
+part 'part.dart';
+import 'dart:core';
+main() {}
+""",
+ 'part.dart': """
+part of test.main;
+""",
+ }]);
+
+ static const MessageKind EXPORT_BEFORE_PARTS = const MessageKind(
+ "Export declarations must come before parts.",
+ howToFix: "Try moving this export further up in the file.",
+ examples: const [
+ const <String, String>{
+ 'main.dart': """
+library test.main;
+part 'part.dart';
+export 'dart:core';
+main() {}
+""",
+ 'part.dart': """
+part of test.main;
+""",
+ }]);
+
//////////////////////////////////////////////////////////////////////////////
// Patch errors start.
//////////////////////////////////////////////////////////////////////////////
« 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