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 /** | 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 DUPLICATE_LABEL, | 179 DUPLICATE_LABEL, |
180 DUPLICATE_SERIALIZED_LIBRARY, | 180 DUPLICATE_SERIALIZED_LIBRARY, |
181 DUPLICATE_SUPER_INITIALIZER, | 181 DUPLICATE_SUPER_INITIALIZER, |
182 DUPLICATE_TYPE_VARIABLE_NAME, | 182 DUPLICATE_TYPE_VARIABLE_NAME, |
183 DUPLICATED_LIBRARY_NAME, | 183 DUPLICATED_LIBRARY_NAME, |
184 DUPLICATED_LIBRARY_RESOURCE, | 184 DUPLICATED_LIBRARY_RESOURCE, |
185 DUPLICATED_PART_OF, | 185 DUPLICATED_PART_OF, |
186 DUPLICATED_RESOURCE, | 186 DUPLICATED_RESOURCE, |
187 EMPTY_CATCH_DECLARATION, | 187 EMPTY_CATCH_DECLARATION, |
188 EMPTY_ENUM_DECLARATION, | 188 EMPTY_ENUM_DECLARATION, |
189 EMPTY_NAMED_PARAMETER_LIST, | |
190 EMPTY_OPTIONAL_PARAMETER_LIST, | |
189 EMPTY_HIDE, | 191 EMPTY_HIDE, |
192 EMPTY_SHOW, | |
190 EQUAL_MAP_ENTRY_KEY, | 193 EQUAL_MAP_ENTRY_KEY, |
191 EMPTY_SHOW, | |
192 EXISTING_DEFINITION, | 194 EXISTING_DEFINITION, |
193 EXISTING_LABEL, | 195 EXISTING_LABEL, |
194 EXPECTED_IDENTIFIER_NOT_RESERVED_WORD, | 196 EXPECTED_IDENTIFIER_NOT_RESERVED_WORD, |
195 EXPERIMENTAL_ASSERT_MESSAGE, | 197 EXPERIMENTAL_ASSERT_MESSAGE, |
196 EXPONENT_MISSING, | 198 EXPONENT_MISSING, |
197 EXPORT_BEFORE_PARTS, | 199 EXPORT_BEFORE_PARTS, |
198 EXTERNAL_WITH_BODY, | 200 EXTERNAL_WITH_BODY, |
199 EXTRA_CATCH_DECLARATION, | 201 EXTRA_CATCH_DECLARATION, |
200 EXTRA_FORMALS, | 202 EXTRA_FORMALS, |
201 EXTRANEOUS_MODIFIER, | 203 EXTRANEOUS_MODIFIER, |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
871 main() {}""" | 873 main() {}""" |
872 }, | 874 }, |
873 const { | 875 const { |
874 'main.dart': """ | 876 'main.dart': """ |
875 export 'dart:core' show Foo; | 877 export 'dart:core' show Foo; |
876 | 878 |
877 main() {}""" | 879 main() {}""" |
878 }, | 880 }, |
879 ]), | 881 ]), |
880 | 882 |
883 MessageKind.EMPTY_OPTIONAL_PARAMETER_LIST: const MessageTemplate( | |
884 MessageKind.EMPTY_OPTIONAL_PARAMETER_LIST, | |
885 "Optional parameter lists cannot be empty.", | |
886 howToFix: "Try adding an optional parameter to the list.", | |
887 examples: const [ | |
888 const { | |
889 'main.dart': """ | |
890 foo({}) {} | |
Johnni Winther
2016/07/08 07:30:52
The examples in these kinds are swapped: {} should
| |
891 | |
892 main() { | |
893 foo(); | |
894 }""" | |
895 } | |
896 ]), | |
897 | |
898 MessageKind.EMPTY_NAMED_PARAMETER_LIST: const MessageTemplate( | |
899 MessageKind.EMPTY_NAMED_PARAMETER_LIST, | |
900 "Named parameter lists cannot be empty.", | |
901 howToFix: "Try adding a named parameter to the list.", | |
902 examples: const [ | |
903 const { | |
904 'main.dart': """ | |
905 foo([]) {} | |
906 | |
907 main() { | |
908 foo(); | |
909 }""" | |
910 } | |
911 ]), | |
912 | |
881 MessageKind.NOT_A_TYPE: const MessageTemplate( | 913 MessageKind.NOT_A_TYPE: const MessageTemplate( |
882 MessageKind.NOT_A_TYPE, "'#{node}' is not a type."), | 914 MessageKind.NOT_A_TYPE, "'#{node}' is not a type."), |
883 | 915 |
884 MessageKind.NOT_A_PREFIX: const MessageTemplate( | 916 MessageKind.NOT_A_PREFIX: const MessageTemplate( |
885 MessageKind.NOT_A_PREFIX, "'#{node}' is not a prefix."), | 917 MessageKind.NOT_A_PREFIX, "'#{node}' is not a prefix."), |
886 | 918 |
887 MessageKind.PREFIX_AS_EXPRESSION: const MessageTemplate( | 919 MessageKind.PREFIX_AS_EXPRESSION: const MessageTemplate( |
888 MessageKind.PREFIX_AS_EXPRESSION, | 920 MessageKind.PREFIX_AS_EXPRESSION, |
889 "Library prefix '#{prefix}' is not a valid expression."), | 921 "Library prefix '#{prefix}' is not a valid expression."), |
890 | 922 |
(...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3781 static String convertToString(value) { | 3813 static String convertToString(value) { |
3782 if (value is ErrorToken) { | 3814 if (value is ErrorToken) { |
3783 // Shouldn't happen. | 3815 // Shouldn't happen. |
3784 return value.assertionMessage; | 3816 return value.assertionMessage; |
3785 } else if (value is Token) { | 3817 } else if (value is Token) { |
3786 value = value.value; | 3818 value = value.value; |
3787 } | 3819 } |
3788 return '$value'; | 3820 return '$value'; |
3789 } | 3821 } |
3790 } | 3822 } |
OLD | NEW |