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

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

Issue 2738693004: Parse script tags with Fasta. (Closed)
Patch Set: 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
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 '../parser/error_kind.dart' show ErrorKind; 7 import '../parser/error_kind.dart' show ErrorKind;
8 8
9 import '../scanner/error_token.dart' show ErrorToken; 9 import '../scanner/error_token.dart' show ErrorToken;
10 10
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 var keyword = 554 var keyword =
555 _keywordMap[syntax] ?? internalError('Unknown keyword: $syntax'); 555 _keywordMap[syntax] ?? internalError('Unknown keyword: $syntax');
556 if (commentToken == null) { 556 if (commentToken == null) {
557 return new analyzer.KeywordToken(keyword, token.charOffset); 557 return new analyzer.KeywordToken(keyword, token.charOffset);
558 } else { 558 } else {
559 return new analyzer.KeywordTokenWithComment( 559 return new analyzer.KeywordTokenWithComment(
560 keyword, token.charOffset, commentToken); 560 keyword, token.charOffset, commentToken);
561 } 561 }
562 break; 562 break;
563 563
564 case SCRIPT_TOKEN:
565 return makeStringToken(TokenType.SCRIPT_TAG);
566
564 case STRING_TOKEN: 567 case STRING_TOKEN:
565 return makeStringToken(TokenType.STRING); 568 return makeStringToken(TokenType.STRING);
566 569
567 case OPEN_CURLY_BRACKET_TOKEN: 570 case OPEN_CURLY_BRACKET_TOKEN:
568 case OPEN_SQUARE_BRACKET_TOKEN: 571 case OPEN_SQUARE_BRACKET_TOKEN:
569 case OPEN_PAREN_TOKEN: 572 case OPEN_PAREN_TOKEN:
570 case STRING_INTERPOLATION_TOKEN: 573 case STRING_INTERPOLATION_TOKEN:
571 return makeBeginToken(getTokenType(token)); 574 return makeBeginToken(getTokenType(token));
572 575
573 default: 576 default:
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 case PERIOD_PERIOD_PERIOD_TOKEN: 781 case PERIOD_PERIOD_PERIOD_TOKEN:
779 return TokenType.PERIOD_PERIOD_PERIOD; 782 return TokenType.PERIOD_PERIOD_PERIOD;
780 // case GENERIC_METHOD_TYPE_LIST_TOKEN: 783 // case GENERIC_METHOD_TYPE_LIST_TOKEN:
781 // return TokenType.GENERIC_METHOD_TYPE_LIST; 784 // return TokenType.GENERIC_METHOD_TYPE_LIST;
782 // case GENERIC_METHOD_TYPE_ASSIGN_TOKEN: 785 // case GENERIC_METHOD_TYPE_ASSIGN_TOKEN:
783 // return TokenType.GENERIC_METHOD_TYPE_ASSIGN; 786 // return TokenType.GENERIC_METHOD_TYPE_ASSIGN;
784 default: 787 default:
785 return internalError("Unhandled token ${token.info}"); 788 return internalError("Unhandled token ${token.info}");
786 } 789 }
787 } 790 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart ('k') | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698