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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/scanner/parser.dart

Issue 14969024: Fix parser in case of unmatched angle bracket. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Re-upload Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js/parser_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of scanner; 5 part of scanner;
6 6
7 /** 7 /**
8 * An event generating parser of Dart programs. This parser expects 8 * An event generating parser of Dart programs. This parser expects
9 * all tokens in a linked list (aka a token stream). 9 * all tokens in a linked list (aka a token stream).
10 * 10 *
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 if (optional('.', token.next)) { 693 if (optional('.', token.next)) {
694 // type '.' ... 694 // type '.' ...
695 if (token.next.next.isIdentifier()) { 695 if (token.next.next.isIdentifier()) {
696 // type '.' identifier 696 // type '.' identifier
697 token = token.next.next; 697 token = token.next.next;
698 } 698 }
699 } 699 }
700 if (optional('<', token.next)) { 700 if (optional('<', token.next)) {
701 if (token.next is BeginGroupToken) { 701 if (token.next is BeginGroupToken) {
702 BeginGroupToken beginGroup = token.next; 702 BeginGroupToken beginGroup = token.next;
703 if (beginGroup.endGroup == null) {
704 listener.unmatched(beginGroup);
705 }
703 token = beginGroup.endGroup; 706 token = beginGroup.endGroup;
704 } 707 }
705 } 708 }
706 } 709 }
707 token = token.next; 710 token = token.next;
708 } 711 }
709 return listener.expectedDeclaration(start); 712 return listener.expectedDeclaration(start);
710 } 713 }
711 714
712 Token parseVariableInitializerOpt(Token token) { 715 Token parseVariableInitializerOpt(Token token) {
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 } 2198 }
2196 listener.handleContinueStatement(hasTarget, continueKeyword, token); 2199 listener.handleContinueStatement(hasTarget, continueKeyword, token);
2197 return expectSemicolon(token); 2200 return expectSemicolon(token);
2198 } 2201 }
2199 2202
2200 Token parseEmptyStatement(Token token) { 2203 Token parseEmptyStatement(Token token) {
2201 listener.handleEmptyStatement(token); 2204 listener.handleEmptyStatement(token);
2202 return expectSemicolon(token); 2205 return expectSemicolon(token);
2203 } 2206 }
2204 } 2207 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698