| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library fasta.parser.parser; | 5 library fasta.parser.parser; |
| 6 | 6 |
| 7 import '../fasta_codes.dart' | 7 import '../fasta_codes.dart' |
| 8 show | 8 show |
| 9 FastaCode, | 9 FastaCode, |
| 10 FastaMessage, | 10 FastaMessage, |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 } | 798 } |
| 799 listener.handleNoType(token); | 799 listener.handleNoType(token); |
| 800 return token; | 800 return token; |
| 801 } | 801 } |
| 802 | 802 |
| 803 bool isValidTypeReference(Token token) { | 803 bool isValidTypeReference(Token token) { |
| 804 final kind = token.kind; | 804 final kind = token.kind; |
| 805 if (identical(kind, IDENTIFIER_TOKEN)) return true; | 805 if (identical(kind, IDENTIFIER_TOKEN)) return true; |
| 806 if (identical(kind, KEYWORD_TOKEN)) { | 806 if (identical(kind, KEYWORD_TOKEN)) { |
| 807 Keyword keyword = (token as KeywordToken).keyword; | 807 Keyword keyword = (token as KeywordToken).keyword; |
| 808 String value = keyword.syntax; | 808 String value = keyword.lexeme; |
| 809 return keyword.isPseudo || | 809 return keyword.isPseudo || |
| 810 (identical(value, 'dynamic')) || | 810 (identical(value, 'dynamic')) || |
| 811 (identical(value, 'void')); | 811 (identical(value, 'void')); |
| 812 } | 812 } |
| 813 return false; | 813 return false; |
| 814 } | 814 } |
| 815 | 815 |
| 816 /// Returns true if [token] matches '<' type (',' type)* '>' '(', and | 816 /// Returns true if [token] matches '<' type (',' type)* '>' '(', and |
| 817 /// otherwise returns false. The final '(' is not part of the grammar | 817 /// otherwise returns false. The final '(' is not part of the grammar |
| 818 /// construct `typeArguments`, but it is required here such that type | 818 /// construct `typeArguments`, but it is required here such that type |
| (...skipping 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3893 return reportUnrecoverableError( | 3893 return reportUnrecoverableError( |
| 3894 token, () => code.format(uri, token.charOffset, string)); | 3894 token, () => code.format(uri, token.charOffset, string)); |
| 3895 } | 3895 } |
| 3896 } | 3896 } |
| 3897 | 3897 |
| 3898 typedef FastaMessage NoArgument(Uri uri, int charOffset); | 3898 typedef FastaMessage NoArgument(Uri uri, int charOffset); |
| 3899 | 3899 |
| 3900 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); | 3900 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); |
| 3901 | 3901 |
| 3902 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); | 3902 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); |
| OLD | NEW |