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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1068263002: improve parser recovery for import statements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.parser; 8 library engine.parser;
9 9
10 import "dart:math" as math; 10 import "dart:math" as math;
(...skipping 5951 matching lines...) Expand 10 before | Expand all | Expand 10 after
5962 SimpleIdentifier prefix = null; 5962 SimpleIdentifier prefix = null;
5963 if (_matchesKeyword(Keyword.DEFERRED)) { 5963 if (_matchesKeyword(Keyword.DEFERRED)) {
5964 deferredToken = getAndAdvance(); 5964 deferredToken = getAndAdvance();
5965 } 5965 }
5966 if (_matchesKeyword(Keyword.AS)) { 5966 if (_matchesKeyword(Keyword.AS)) {
5967 asToken = getAndAdvance(); 5967 asToken = getAndAdvance();
5968 prefix = parseSimpleIdentifier(); 5968 prefix = parseSimpleIdentifier();
5969 } else if (deferredToken != null) { 5969 } else if (deferredToken != null) {
5970 _reportErrorForCurrentToken( 5970 _reportErrorForCurrentToken(
5971 ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT); 5971 ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT);
5972 } else if (!_matches(TokenType.SEMICOLON) && 5972 } else if (!_matches(TokenType.SEMICOLON)) {
5973 _tokenMatchesKeyword(_peek(), Keyword.AS)) { 5973 Token nextToken = _peek();
5974 _reportErrorForCurrentToken( 5974 if (_tokenMatchesKeyword(nextToken, Keyword.AS) ||
5975 ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken]); 5975 _tokenMatchesString(nextToken, _SHOW) ||
5976 _advance(); 5976 _tokenMatchesString(nextToken, _HIDE)) {
5977 asToken = getAndAdvance(); 5977 _reportErrorForCurrentToken(
5978 prefix = parseSimpleIdentifier(); 5978 ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken]);
5979 _advance();
5980 if (_matchesKeyword(Keyword.AS)) {
5981 asToken = getAndAdvance();
5982 prefix = parseSimpleIdentifier();
5983 }
5984 }
5979 } 5985 }
5980 List<Combinator> combinators = _parseCombinators(); 5986 List<Combinator> combinators = _parseCombinators();
5981 Token semicolon = _expectSemicolon(); 5987 Token semicolon = _expectSemicolon();
5982 return new ImportDirective(commentAndMetadata.comment, 5988 return new ImportDirective(commentAndMetadata.comment,
5983 commentAndMetadata.metadata, importKeyword, libraryUri, deferredToken, 5989 commentAndMetadata.metadata, importKeyword, libraryUri, deferredToken,
5984 asToken, prefix, combinators, semicolon); 5990 asToken, prefix, combinators, semicolon);
5985 } 5991 }
5986 5992
5987 /** 5993 /**
5988 * Parse a list of initialized identifiers. The [commentAndMetadata] is the 5994 * Parse a list of initialized identifiers. The [commentAndMetadata] is the
(...skipping 4581 matching lines...) Expand 10 before | Expand all | Expand 10 after
10570 } 10576 }
10571 10577
10572 /** 10578 /**
10573 * Copy resolution data from the [fromNode] to the [toNode]. 10579 * Copy resolution data from the [fromNode] to the [toNode].
10574 */ 10580 */
10575 static void copyResolutionData(AstNode fromNode, AstNode toNode) { 10581 static void copyResolutionData(AstNode fromNode, AstNode toNode) {
10576 ResolutionCopier copier = new ResolutionCopier(); 10582 ResolutionCopier copier = new ResolutionCopier();
10577 copier._isEqualNodes(fromNode, toNode); 10583 copier._isEqualNodes(fromNode, toNode);
10578 } 10584 }
10579 } 10585 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698