| 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 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 // class that was parsed. | 2437 // class that was parsed. |
| 2438 _parseClassDeclaration(commentAndMetadata, null); | 2438 _parseClassDeclaration(commentAndMetadata, null); |
| 2439 return null; | 2439 return null; |
| 2440 } else if (_matchesKeyword(Keyword.ABSTRACT) && | 2440 } else if (_matchesKeyword(Keyword.ABSTRACT) && |
| 2441 _tokenMatchesKeyword(_peek(), Keyword.CLASS)) { | 2441 _tokenMatchesKeyword(_peek(), Keyword.CLASS)) { |
| 2442 _reportErrorForToken(ParserErrorCode.CLASS_IN_CLASS, _peek()); | 2442 _reportErrorForToken(ParserErrorCode.CLASS_IN_CLASS, _peek()); |
| 2443 // TODO(brianwilkerson) We don't currently have any way to capture the | 2443 // TODO(brianwilkerson) We don't currently have any way to capture the |
| 2444 // class that was parsed. | 2444 // class that was parsed. |
| 2445 _parseClassDeclaration(commentAndMetadata, getAndAdvance()); | 2445 _parseClassDeclaration(commentAndMetadata, getAndAdvance()); |
| 2446 return null; | 2446 return null; |
| 2447 } else if (_matchesKeyword(Keyword.ENUM)) { |
| 2448 _reportErrorForToken(ParserErrorCode.ENUM_IN_CLASS, _peek()); |
| 2449 // TODO(brianwilkerson) We don't currently have any way to capture the |
| 2450 // enum that was parsed. |
| 2451 _parseEnumDeclaration(commentAndMetadata); |
| 2452 return null; |
| 2447 } else if (_isOperator(_currentToken)) { | 2453 } else if (_isOperator(_currentToken)) { |
| 2448 // | 2454 // |
| 2449 // We appear to have found an operator declaration without the | 2455 // We appear to have found an operator declaration without the |
| 2450 // 'operator' keyword. | 2456 // 'operator' keyword. |
| 2451 // | 2457 // |
| 2452 _validateModifiersForOperator(modifiers); | 2458 _validateModifiersForOperator(modifiers); |
| 2453 return _parseOperator( | 2459 return _parseOperator( |
| 2454 commentAndMetadata, modifiers.externalKeyword, null); | 2460 commentAndMetadata, modifiers.externalKeyword, null); |
| 2455 } | 2461 } |
| 2456 Token keyword = modifiers.varKeyword; | 2462 Token keyword = modifiers.varKeyword; |
| (...skipping 6856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9313 static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = | 9319 static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = |
| 9314 const ParserErrorCode('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', | 9320 const ParserErrorCode('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', |
| 9315 "The label {0} was already used in this switch statement"); | 9321 "The label {0} was already used in this switch statement"); |
| 9316 | 9322 |
| 9317 static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode( | 9323 static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode( |
| 9318 'DUPLICATED_MODIFIER', "The modifier '{0}' was already specified."); | 9324 'DUPLICATED_MODIFIER', "The modifier '{0}' was already specified."); |
| 9319 | 9325 |
| 9320 static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode( | 9326 static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode( |
| 9321 'EMPTY_ENUM_BODY', "An enum must declare at least one constant name"); | 9327 'EMPTY_ENUM_BODY', "An enum must declare at least one constant name"); |
| 9322 | 9328 |
| 9329 static const ParserErrorCode ENUM_IN_CLASS = const ParserErrorCode( |
| 9330 'ENUM_IN_CLASS', "Enums cannot be declared inside classes"); |
| 9331 |
| 9323 static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = | 9332 static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = |
| 9324 const ParserErrorCode('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', | 9333 const ParserErrorCode('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', |
| 9325 "Equality expression cannot be operand of another equality expression.
"); | 9334 "Equality expression cannot be operand of another equality expression.
"); |
| 9326 | 9335 |
| 9327 static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode( | 9336 static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode( |
| 9328 'EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'"); | 9337 'EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'"); |
| 9329 | 9338 |
| 9330 static const ParserErrorCode EXPECTED_CLASS_MEMBER = | 9339 static const ParserErrorCode EXPECTED_CLASS_MEMBER = |
| 9331 const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member"); | 9340 const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member"); |
| 9332 | 9341 |
| (...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11147 * Copy resolution data from one node to another. | 11156 * Copy resolution data from one node to another. |
| 11148 * | 11157 * |
| 11149 * @param fromNode the node from which resolution information will be copied | 11158 * @param fromNode the node from which resolution information will be copied |
| 11150 * @param toNode the node to which resolution information will be copied | 11159 * @param toNode the node to which resolution information will be copied |
| 11151 */ | 11160 */ |
| 11152 static void copyResolutionData(AstNode fromNode, AstNode toNode) { | 11161 static void copyResolutionData(AstNode fromNode, AstNode toNode) { |
| 11153 ResolutionCopier copier = new ResolutionCopier(); | 11162 ResolutionCopier copier = new ResolutionCopier(); |
| 11154 copier._isEqualNodes(fromNode, toNode); | 11163 copier._isEqualNodes(fromNode, toNode); |
| 11155 } | 11164 } |
| 11156 } | 11165 } |
| OLD | NEW |