| 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 'package:front_end/src/fasta/parser/error_kind.dart' show ErrorKind; | 7 import 'package:front_end/src/fasta/parser/error_kind.dart' show ErrorKind; |
| 8 | 8 |
| 9 import 'package:front_end/src/fasta/scanner/error_token.dart' show ErrorToken; | 9 import 'package:front_end/src/fasta/scanner/error_token.dart' show ErrorToken; |
| 10 | 10 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 return string(INT_INFO); | 343 return string(INT_INFO); |
| 344 case TokenType.KEYWORD: | 344 case TokenType.KEYWORD: |
| 345 var keyword = Keyword.keywords[token.lexeme]; | 345 var keyword = Keyword.keywords[token.lexeme]; |
| 346 if (keyword != null) { | 346 if (keyword != null) { |
| 347 return new KeywordToken(keyword, token.offset); | 347 return new KeywordToken(keyword, token.offset); |
| 348 } else { | 348 } else { |
| 349 return internalError("Unrecognized keyword: '${token.lexeme}'."); | 349 return internalError("Unrecognized keyword: '${token.lexeme}'."); |
| 350 } | 350 } |
| 351 break; | 351 break; |
| 352 case TokenType.MULTI_LINE_COMMENT: | 352 case TokenType.MULTI_LINE_COMMENT: |
| 353 return string(COMMENT_INFO); | 353 return string(MULTI_LINE_COMMENT_INFO); |
| 354 // case TokenType.SCRIPT_TAG | 354 // case TokenType.SCRIPT_TAG |
| 355 case TokenType.SINGLE_LINE_COMMENT: | 355 case TokenType.SINGLE_LINE_COMMENT: |
| 356 return string(COMMENT_INFO); | 356 return string(SINGLE_LINE_COMMENT_INFO); |
| 357 case TokenType.STRING: | 357 case TokenType.STRING: |
| 358 return string(STRING_INFO); | 358 return string(STRING_INFO); |
| 359 case TokenType.AMPERSAND: | 359 case TokenType.AMPERSAND: |
| 360 return symbol(AMPERSAND_INFO); | 360 return symbol(AMPERSAND_INFO); |
| 361 case TokenType.AMPERSAND_AMPERSAND: | 361 case TokenType.AMPERSAND_AMPERSAND: |
| 362 return symbol(AMPERSAND_AMPERSAND_INFO); | 362 return symbol(AMPERSAND_AMPERSAND_INFO); |
| 363 // case TokenType.AMPERSAND_AMPERSAND_EQ | 363 // case TokenType.AMPERSAND_AMPERSAND_EQ |
| 364 case TokenType.AMPERSAND_EQ: | 364 case TokenType.AMPERSAND_EQ: |
| 365 return symbol(AMPERSAND_EQ_INFO); | 365 return symbol(AMPERSAND_EQ_INFO); |
| 366 case TokenType.AT: | 366 case TokenType.AT: |
| (...skipping 415 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 |