| OLD | NEW |
| 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 4225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4236 Expression index = parseExpression2(); | 4236 Expression index = parseExpression2(); |
| 4237 Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET); | 4237 Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET); |
| 4238 return new IndexExpression.forTarget( | 4238 return new IndexExpression.forTarget( |
| 4239 prefix, leftBracket, index, rightBracket); | 4239 prefix, leftBracket, index, rightBracket); |
| 4240 } finally { | 4240 } finally { |
| 4241 _inInitializer = wasInInitializer; | 4241 _inInitializer = wasInInitializer; |
| 4242 } | 4242 } |
| 4243 } else if (_matches(TokenType.PERIOD) || | 4243 } else if (_matches(TokenType.PERIOD) || |
| 4244 _matches(TokenType.QUESTION_PERIOD)) { | 4244 _matches(TokenType.QUESTION_PERIOD)) { |
| 4245 if (_matches(TokenType.QUESTION_PERIOD) && !allowConditional) { | 4245 if (_matches(TokenType.QUESTION_PERIOD) && !allowConditional) { |
| 4246 _reportErrorForCurrentToken(ParserErrorCode.INVALID_OPERATOR_FOR_SUPER); | 4246 _reportErrorForCurrentToken( |
| 4247 ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, [_currentToken.lexeme]); |
| 4247 } | 4248 } |
| 4248 Token operator = getAndAdvance(); | 4249 Token operator = getAndAdvance(); |
| 4249 return new PropertyAccess(prefix, operator, parseSimpleIdentifier()); | 4250 return new PropertyAccess(prefix, operator, parseSimpleIdentifier()); |
| 4250 } else { | 4251 } else { |
| 4251 if (!optional) { | 4252 if (!optional) { |
| 4252 // Report the missing selector. | 4253 // Report the missing selector. |
| 4253 _reportErrorForCurrentToken( | 4254 _reportErrorForCurrentToken( |
| 4254 ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR); | 4255 ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR); |
| 4255 } | 4256 } |
| 4256 return prefix; | 4257 return prefix; |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5671 if (!_tokenMatchesString(keyword, ASYNC)) { | 5672 if (!_tokenMatchesString(keyword, ASYNC)) { |
| 5672 _reportErrorForToken(ParserErrorCode.INVALID_SYNC, keyword); | 5673 _reportErrorForToken(ParserErrorCode.INVALID_SYNC, keyword); |
| 5673 keyword = null; | 5674 keyword = null; |
| 5674 } else if (star != null) { | 5675 } else if (star != null) { |
| 5675 _reportErrorForToken( | 5676 _reportErrorForToken( |
| 5676 ParserErrorCode.INVALID_STAR_AFTER_ASYNC, star); | 5677 ParserErrorCode.INVALID_STAR_AFTER_ASYNC, star); |
| 5677 } | 5678 } |
| 5678 } | 5679 } |
| 5679 Token functionDefinition = getAndAdvance(); | 5680 Token functionDefinition = getAndAdvance(); |
| 5680 if (_matchesKeyword(Keyword.RETURN)) { | 5681 if (_matchesKeyword(Keyword.RETURN)) { |
| 5681 _reportErrorForToken( | 5682 _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, |
| 5682 ParserErrorCode.UNEXPECTED_TOKEN, getAndAdvance()); | 5683 [_currentToken.lexeme]); |
| 5684 _advance(); |
| 5683 } | 5685 } |
| 5684 Expression expression = parseExpression2(); | 5686 Expression expression = parseExpression2(); |
| 5685 Token semicolon = null; | 5687 Token semicolon = null; |
| 5686 if (!inExpression) { | 5688 if (!inExpression) { |
| 5687 semicolon = _expect(TokenType.SEMICOLON); | 5689 semicolon = _expect(TokenType.SEMICOLON); |
| 5688 } | 5690 } |
| 5689 if (!_parseFunctionBodies) { | 5691 if (!_parseFunctionBodies) { |
| 5690 return new EmptyFunctionBody( | 5692 return new EmptyFunctionBody( |
| 5691 _createSyntheticToken(TokenType.SEMICOLON)); | 5693 _createSyntheticToken(TokenType.SEMICOLON)); |
| 5692 } | 5694 } |
| (...skipping 4868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10561 } | 10563 } |
| 10562 | 10564 |
| 10563 /** | 10565 /** |
| 10564 * Copy resolution data from the [fromNode] to the [toNode]. | 10566 * Copy resolution data from the [fromNode] to the [toNode]. |
| 10565 */ | 10567 */ |
| 10566 static void copyResolutionData(AstNode fromNode, AstNode toNode) { | 10568 static void copyResolutionData(AstNode fromNode, AstNode toNode) { |
| 10567 ResolutionCopier copier = new ResolutionCopier(); | 10569 ResolutionCopier copier = new ResolutionCopier(); |
| 10568 copier._isEqualNodes(fromNode, toNode); | 10570 copier._isEqualNodes(fromNode, toNode); |
| 10569 } | 10571 } |
| 10570 } | 10572 } |
| OLD | NEW |