OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 errors produced during syntactic analysis (scanning and parsing). | 6 * The errors produced during syntactic analysis (scanning and parsing). |
7 */ | 7 */ |
8 library analyzer.src.dart.error.syntactic_errors; | 8 library analyzer.src.dart.error.syntactic_errors; |
9 | 9 |
10 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 "The return type can't be 'var'.", | 975 "The return type can't be 'var'.", |
976 "Try removing the keyword 'var', or " | 976 "Try removing the keyword 'var', or " |
977 "replacing it with the name of the return type."); | 977 "replacing it with the name of the return type."); |
978 | 978 |
979 static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode( | 979 static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode( |
980 'VAR_TYPEDEF', | 980 'VAR_TYPEDEF', |
981 "Typedefs can't be declared to be 'var'.", | 981 "Typedefs can't be declared to be 'var'.", |
982 "Try removing the keyword 'var', or " | 982 "Try removing the keyword 'var', or " |
983 "replacing it with the name of the return type."); | 983 "replacing it with the name of the return type."); |
984 | 984 |
985 static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode( | |
986 'VOID_PARAMETER', | |
987 "Parameters can't have a type of 'void'.", | |
988 "Try removing the keyword 'var', or " | |
989 "replacing it with the name of the type of the parameter."); | |
990 | |
991 static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode( | |
992 'VOID_VARIABLE', | |
993 "Variables can't have a type of 'void'.", | |
994 "Try removing the keyword 'void', or " | |
995 "replacing it with the name of the type of the variable."); | |
996 | |
997 /** | 985 /** |
998 * Initialize a newly created error code to have the given [name]. The message | 986 * Initialize a newly created error code to have the given [name]. The message |
999 * associated with the error will be created from the given [message] | 987 * associated with the error will be created from the given [message] |
1000 * template. The correction associated with the error will be created from the | 988 * template. The correction associated with the error will be created from the |
1001 * given [correction] template. | 989 * given [correction] template. |
1002 */ | 990 */ |
1003 const ParserErrorCode(String name, String message, [String correction]) | 991 const ParserErrorCode(String name, String message, [String correction]) |
1004 : super(name, message, correction); | 992 : super(name, message, correction); |
1005 | 993 |
1006 @override | 994 @override |
1007 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; | 995 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; |
1008 | 996 |
1009 @override | 997 @override |
1010 ErrorType get type => ErrorType.SYNTACTIC_ERROR; | 998 ErrorType get type => ErrorType.SYNTACTIC_ERROR; |
1011 } | 999 } |
OLD | NEW |