| OLD | NEW |
| 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 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 "void x; main() {}", | 1119 "void x; main() {}", |
| 1120 "foo(void x) {} main() { foo(null); }", | 1120 "foo(void x) {} main() { foo(null); }", |
| 1121 ]); | 1121 ]); |
| 1122 | 1122 |
| 1123 static const MessageKind NULL_NOT_ALLOWED = const MessageKind( | 1123 static const MessageKind NULL_NOT_ALLOWED = const MessageKind( |
| 1124 "`null` can't be used here."); | 1124 "`null` can't be used here."); |
| 1125 | 1125 |
| 1126 static const MessageKind BEFORE_TOP_LEVEL = const MessageKind( | 1126 static const MessageKind BEFORE_TOP_LEVEL = const MessageKind( |
| 1127 "Part header must come before top-level definitions."); | 1127 "Part header must come before top-level definitions."); |
| 1128 | 1128 |
| 1129 static const MessageKind IMPORT_PART_OF = const MessageKind( |
| 1130 "The imported library must not have a 'part-of' directive.", |
| 1131 howToFix: "Try removing the 'part-of' directive or replacing the " |
| 1132 "import of the library with a 'part' directive.", |
| 1133 examples: const [const { |
| 1134 'main.dart': """ |
| 1135 library library; |
| 1136 |
| 1137 import 'part.dart'; |
| 1138 |
| 1139 main() {} |
| 1140 """, |
| 1141 |
| 1142 'part.dart': """ |
| 1143 part of library; |
| 1144 """}]); |
| 1145 |
| 1129 static const MessageKind LIBRARY_NAME_MISMATCH = const MessageKind( | 1146 static const MessageKind LIBRARY_NAME_MISMATCH = const MessageKind( |
| 1130 "Expected part of library name '#{libraryName}'.", | 1147 "Expected part of library name '#{libraryName}'.", |
| 1131 howToFix: "Trying changing the directive to 'part of #{libraryName};'.", | 1148 howToFix: "Try changing the directive to 'part of #{libraryName};'.", |
| 1132 examples: const [const { | 1149 examples: const [const { |
| 1133 'main.dart': """ | 1150 'main.dart': """ |
| 1134 library lib.foo; | 1151 library lib.foo; |
| 1135 | 1152 |
| 1136 part 'part.dart'; | 1153 part 'part.dart'; |
| 1137 | 1154 |
| 1138 main() {} | 1155 main() {} |
| 1139 """, | 1156 """, |
| 1140 | 1157 |
| 1141 'part.dart': """ | 1158 'part.dart': """ |
| 1142 part of lib.bar; | 1159 part of lib.bar; |
| 1143 """}]); | 1160 """}]); |
| 1144 | 1161 |
| 1145 static const MessageKind MISSING_LIBRARY_NAME = const MessageKind( | 1162 static const MessageKind MISSING_LIBRARY_NAME = const MessageKind( |
| 1146 "Library has no name. Part directive expected library name " | 1163 "Library has no name. Part directive expected library name " |
| 1147 "to be '#{libraryName}'.", | 1164 "to be '#{libraryName}'.", |
| 1148 howToFix: "Trying adding 'library #{libraryName};' to the library.", | 1165 howToFix: "Try adding 'library #{libraryName};' to the library.", |
| 1149 examples: const [const { | 1166 examples: const [const { |
| 1150 'main.dart': """ | 1167 'main.dart': """ |
| 1151 part 'part.dart'; | 1168 part 'part.dart'; |
| 1152 | 1169 |
| 1153 main() {} | 1170 main() {} |
| 1154 """, | 1171 """, |
| 1155 | 1172 |
| 1156 'part.dart': """ | 1173 'part.dart': """ |
| 1157 part of lib.foo; | 1174 part of lib.foo; |
| 1158 """}]); | 1175 """}]); |
| 1159 | 1176 |
| 1160 static const MessageKind THIS_IS_THE_PART_OF_TAG = const MessageKind( | 1177 static const MessageKind THIS_IS_THE_PART_OF_TAG = const MessageKind( |
| 1161 "This is the part of directive."); | 1178 "This is the part of directive."); |
| 1162 | 1179 |
| 1163 static const MessageKind MISSING_PART_OF_TAG = const MessageKind( | 1180 static const MessageKind MISSING_PART_OF_TAG = const MessageKind( |
| 1164 "This file has no part-of tag, but it is being used as a part."); | 1181 "This file has no part-of tag, but it is being used as a part."); |
| 1165 | 1182 |
| 1166 static const MessageKind DUPLICATED_PART_OF = const MessageKind( | 1183 static const MessageKind DUPLICATED_PART_OF = const MessageKind( |
| 1167 "Duplicated part-of directive."); | 1184 "Duplicated part-of directive."); |
| 1168 | 1185 |
| 1169 static const MessageKind ILLEGAL_DIRECTIVE = const MessageKind( | |
| 1170 "Directive not allowed here."); | |
| 1171 | |
| 1172 static const MessageKind DUPLICATED_LIBRARY_NAME = const MessageKind( | 1186 static const MessageKind DUPLICATED_LIBRARY_NAME = const MessageKind( |
| 1173 "Duplicated library name '#{libraryName}'."); | 1187 "Duplicated library name '#{libraryName}'."); |
| 1174 | 1188 |
| 1175 static const MessageKind DUPLICATED_RESOURCE = const MessageKind( | 1189 static const MessageKind DUPLICATED_RESOURCE = const MessageKind( |
| 1176 "The resource '#{resourceUri}' is loaded through both " | 1190 "The resource '#{resourceUri}' is loaded through both " |
| 1177 "'#{canonicalUri1}' and '#{canonicalUri2}'."); | 1191 "'#{canonicalUri1}' and '#{canonicalUri2}'."); |
| 1178 | 1192 |
| 1179 static const MessageKind DUPLICATED_LIBRARY_RESOURCE = | 1193 static const MessageKind DUPLICATED_LIBRARY_RESOURCE = |
| 1180 const MessageKind( | 1194 const MessageKind( |
| 1181 "The library '#{libraryName}' in '#{resourceUri}' is loaded through " | 1195 "The library '#{libraryName}' in '#{resourceUri}' is loaded through " |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2427 static String convertToString(value) { | 2441 static String convertToString(value) { |
| 2428 if (value is ErrorToken) { | 2442 if (value is ErrorToken) { |
| 2429 // Shouldn't happen. | 2443 // Shouldn't happen. |
| 2430 return value.assertionMessage; | 2444 return value.assertionMessage; |
| 2431 } else if (value is Token) { | 2445 } else if (value is Token) { |
| 2432 value = value.value; | 2446 value = value.value; |
| 2433 } | 2447 } |
| 2434 return '$value'; | 2448 return '$value'; |
| 2435 } | 2449 } |
| 2436 } | 2450 } |
| OLD | NEW |