Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: pkg/analyzer/lib/src/fasta/token_utils.dart

Issue 2761683002: fix scriptTag scanner_round_trip test (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/test/scanner_roundtrip_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(MULTI_LINE_COMMENT_INFO); 353 return string(MULTI_LINE_COMMENT_INFO);
354 // case TokenType.SCRIPT_TAG 354 case TokenType.SCRIPT_TAG:
355 return string(SCRIPT_INFO);
355 case TokenType.SINGLE_LINE_COMMENT: 356 case TokenType.SINGLE_LINE_COMMENT:
356 return string(SINGLE_LINE_COMMENT_INFO); 357 return string(SINGLE_LINE_COMMENT_INFO);
357 case TokenType.STRING: 358 case TokenType.STRING:
358 return string(STRING_INFO); 359 return string(STRING_INFO);
359 case TokenType.AMPERSAND: 360 case TokenType.AMPERSAND:
360 return symbol(AMPERSAND_INFO); 361 return symbol(AMPERSAND_INFO);
361 case TokenType.AMPERSAND_AMPERSAND: 362 case TokenType.AMPERSAND_AMPERSAND:
362 return symbol(AMPERSAND_AMPERSAND_INFO); 363 return symbol(AMPERSAND_AMPERSAND_INFO);
363 // case TokenType.AMPERSAND_AMPERSAND_EQ 364 // case TokenType.AMPERSAND_AMPERSAND_EQ
364 case TokenType.AMPERSAND_EQ: 365 case TokenType.AMPERSAND_EQ:
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 case PERIOD_PERIOD_PERIOD_TOKEN: 783 case PERIOD_PERIOD_PERIOD_TOKEN:
783 return TokenType.PERIOD_PERIOD_PERIOD; 784 return TokenType.PERIOD_PERIOD_PERIOD;
784 // case GENERIC_METHOD_TYPE_LIST_TOKEN: 785 // case GENERIC_METHOD_TYPE_LIST_TOKEN:
785 // return TokenType.GENERIC_METHOD_TYPE_LIST; 786 // return TokenType.GENERIC_METHOD_TYPE_LIST;
786 // case GENERIC_METHOD_TYPE_ASSIGN_TOKEN: 787 // case GENERIC_METHOD_TYPE_ASSIGN_TOKEN:
787 // return TokenType.GENERIC_METHOD_TYPE_ASSIGN; 788 // return TokenType.GENERIC_METHOD_TYPE_ASSIGN;
788 default: 789 default:
789 return internalError("Unhandled token ${token.info}"); 790 return internalError("Unhandled token ${token.info}");
790 } 791 }
791 } 792 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/test/scanner_roundtrip_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698