| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.parser.partial_elements; | 5 library dart2js.parser.partial_elements; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show ParsingContext, Resolution; | 8 import '../common/resolution.dart' show ParsingContext, Resolution; |
| 9 import '../dart_types.dart' show DynamicType; | 9 import '../dart_types.dart' show DynamicType; |
| 10 import '../elements/elements.dart' | 10 import '../elements/elements.dart' |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 FunctionExpression parseNode(ParsingContext parsing) { | 86 FunctionExpression parseNode(ParsingContext parsing) { |
| 87 if (cachedNode != null) return cachedNode; | 87 if (cachedNode != null) return cachedNode; |
| 88 parseFunction(Parser p) { | 88 parseFunction(Parser p) { |
| 89 if (isClassMember && modifiers.isFactory) { | 89 if (isClassMember && modifiers.isFactory) { |
| 90 p.parseFactoryMethod(beginToken); | 90 p.parseFactoryMethod(beginToken); |
| 91 } else { | 91 } else { |
| 92 p.parseFunction(beginToken, getOrSet); | 92 p.parseFunction(beginToken, getOrSet); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 |
| 95 cachedNode = parse(parsing, this, declarationSite, parseFunction); | 96 cachedNode = parse(parsing, this, declarationSite, parseFunction); |
| 96 return cachedNode; | 97 return cachedNode; |
| 97 } | 98 } |
| 98 | 99 |
| 99 Token get position => _position; | 100 Token get position => _position; |
| 100 | 101 |
| 101 void reusePartialFunctionMixin() { | 102 void reusePartialFunctionMixin() { |
| 102 cachedNode = null; | 103 cachedNode = null; |
| 103 } | 104 } |
| 104 | 105 |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } on ParserError catch (e) { | 444 } on ParserError catch (e) { |
| 444 partial.hasParseError = true; | 445 partial.hasParseError = true; |
| 445 return new ErrorNode(element.position, e.reason); | 446 return new ErrorNode(element.position, e.reason); |
| 446 } | 447 } |
| 447 Node node = listener.popNode(); | 448 Node node = listener.popNode(); |
| 448 assert(listener.nodes.isEmpty); | 449 assert(listener.nodes.isEmpty); |
| 449 return node; | 450 return node; |
| 450 }); | 451 }); |
| 451 }); | 452 }); |
| 452 } | 453 } |
| OLD | NEW |