| 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 "through native extensions.", | 737 "through native extensions.", |
| 738 "Try removing the native clause."); | 738 "Try removing the native clause."); |
| 739 | 739 |
| 740 static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = | 740 static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = |
| 741 const ParserErrorCode( | 741 const ParserErrorCode( |
| 742 'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', | 742 'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', |
| 743 "Native functions can only be declared in the SDK and code that is " | 743 "Native functions can only be declared in the SDK and code that is " |
| 744 "loaded through native extensions.", | 744 "loaded through native extensions.", |
| 745 "Try removing the word 'native'."); | 745 "Try removing the word 'native'."); |
| 746 | 746 |
| 747 static const ParserErrorCode NATIVE_CLAUSE_SHOULD_BE_ANNOTATION = |
| 748 const ParserErrorCode( |
| 749 'NATIVE_CLAUSE_SHOULD_BE_ANNOTATION', |
| 750 "Native clause in this form is deprecated.", |
| 751 "Try removing this native clause and adding @native()" |
| 752 " or @native('native-name') before the declaration."); |
| 753 |
| 747 static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode( | 754 static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode( |
| 748 'NON_CONSTRUCTOR_FACTORY', | 755 'NON_CONSTRUCTOR_FACTORY', |
| 749 "Only a constructor can be declared to be a factory.", | 756 "Only a constructor can be declared to be a factory.", |
| 750 "Try removing the keyword 'factory'."); | 757 "Try removing the keyword 'factory'."); |
| 751 | 758 |
| 752 static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = | 759 static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = |
| 753 const ParserErrorCode( | 760 const ParserErrorCode( |
| 754 'NON_IDENTIFIER_LIBRARY_NAME', | 761 'NON_IDENTIFIER_LIBRARY_NAME', |
| 755 "The name of a library must be an identifier.", | 762 "The name of a library must be an identifier.", |
| 756 "Try using an identifier as the name of the library."); | 763 "Try using an identifier as the name of the library."); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 */ | 997 */ |
| 991 const ParserErrorCode(String name, String message, [String correction]) | 998 const ParserErrorCode(String name, String message, [String correction]) |
| 992 : super(name, message, correction); | 999 : super(name, message, correction); |
| 993 | 1000 |
| 994 @override | 1001 @override |
| 995 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; | 1002 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; |
| 996 | 1003 |
| 997 @override | 1004 @override |
| 998 ErrorType get type => ErrorType.SYNTACTIC_ERROR; | 1005 ErrorType get type => ErrorType.SYNTACTIC_ERROR; |
| 999 } | 1006 } |
| OLD | NEW |