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

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

Issue 2757153002: update fasta scanner to generate two types of comments (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/lib/src/fasta/scanner/abstract_scanner.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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698