| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.analyzer.token_utils; | 5 library fasta.analyzer.token_utils; |
| 6 | 6 |
| 7 import '../parser/error_kind.dart' show ErrorKind; | 7 import 'package:front_end/src/fasta/parser/error_kind.dart' show ErrorKind; |
| 8 | 8 |
| 9 import '../scanner/error_token.dart' show ErrorToken; | 9 import 'package:front_end/src/fasta/scanner/error_token.dart' show ErrorToken; |
| 10 | 10 |
| 11 import '../scanner/keyword.dart' show Keyword; | 11 import 'package:front_end/src/fasta/scanner/keyword.dart' show Keyword; |
| 12 | 12 |
| 13 import '../scanner/precedence.dart'; | 13 import 'package:front_end/src/fasta/scanner/precedence.dart'; |
| 14 | 14 |
| 15 import '../scanner/token.dart' | 15 import 'package:front_end/src/fasta/scanner/token.dart' |
| 16 show BeginGroupToken, KeywordToken, StringToken, SymbolToken, Token; | 16 show BeginGroupToken, KeywordToken, StringToken, SymbolToken, Token; |
| 17 | 17 |
| 18 import '../scanner/token_constants.dart'; | 18 import 'package:front_end/src/fasta/scanner/token_constants.dart'; |
| 19 | 19 |
| 20 import '../../scanner/token.dart' as analyzer | 20 import 'package:front_end/src/scanner/token.dart' as analyzer |
| 21 show | 21 show |
| 22 BeginToken, | 22 BeginToken, |
| 23 BeginTokenWithComment, | 23 BeginTokenWithComment, |
| 24 CommentToken, | 24 CommentToken, |
| 25 Keyword, | 25 Keyword, |
| 26 KeywordToken, | 26 KeywordToken, |
| 27 KeywordTokenWithComment, | 27 KeywordTokenWithComment, |
| 28 StringToken, | 28 StringToken, |
| 29 StringTokenWithComment, | 29 StringTokenWithComment, |
| 30 Token, | 30 Token, |
| 31 TokenWithComment; | 31 TokenWithComment; |
| 32 | 32 |
| 33 import '../../scanner/errors.dart' as analyzer show ScannerErrorCode; | 33 import 'package:front_end/src/scanner/errors.dart' as analyzer show ScannerError
Code; |
| 34 | 34 |
| 35 import 'package:analyzer/dart/ast/token.dart' show TokenType; | 35 import 'package:analyzer/dart/ast/token.dart' show TokenType; |
| 36 | 36 |
| 37 import '../errors.dart' show internalError; | 37 import 'package:front_end/src/fasta/errors.dart' show internalError; |
| 38 | 38 |
| 39 /// Class capable of converting a stream of Fasta tokens to a stream of analyzer | 39 /// Class capable of converting a stream of Fasta tokens to a stream of analyzer |
| 40 /// tokens. | 40 /// tokens. |
| 41 /// | 41 /// |
| 42 /// This is a class rather than an ordinary method so that it can be subclassed | 42 /// This is a class rather than an ordinary method so that it can be subclassed |
| 43 /// in tests. | 43 /// in tests. |
| 44 /// | 44 /// |
| 45 /// TODO(paulberry,ahe): Fasta includes comments directly in the token | 45 /// TODO(paulberry,ahe): Fasta includes comments directly in the token |
| 46 /// stream, rather than pointing to them via a "precedingComment" pointer, as | 46 /// stream, rather than pointing to them via a "precedingComment" pointer, as |
| 47 /// analyzer does. This seems like it will complicate parsing and other | 47 /// analyzer does. This seems like it will complicate parsing and other |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 case PERIOD_PERIOD_PERIOD_TOKEN: | 782 case PERIOD_PERIOD_PERIOD_TOKEN: |
| 783 return TokenType.PERIOD_PERIOD_PERIOD; | 783 return TokenType.PERIOD_PERIOD_PERIOD; |
| 784 // case GENERIC_METHOD_TYPE_LIST_TOKEN: | 784 // case GENERIC_METHOD_TYPE_LIST_TOKEN: |
| 785 // return TokenType.GENERIC_METHOD_TYPE_LIST; | 785 // return TokenType.GENERIC_METHOD_TYPE_LIST; |
| 786 // case GENERIC_METHOD_TYPE_ASSIGN_TOKEN: | 786 // case GENERIC_METHOD_TYPE_ASSIGN_TOKEN: |
| 787 // return TokenType.GENERIC_METHOD_TYPE_ASSIGN; | 787 // return TokenType.GENERIC_METHOD_TYPE_ASSIGN; |
| 788 default: | 788 default: |
| 789 return internalError("Unhandled token ${token.info}"); | 789 return internalError("Unhandled token ${token.info}"); |
| 790 } | 790 } |
| 791 } | 791 } |
| OLD | NEW |