| 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 library engine.ast; | 5 library engine.ast; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'element.dart'; | 9 import 'element.dart'; |
| 10 import 'engine.dart' show AnalysisEngine; | 10 import 'engine.dart' show AnalysisEngine; |
| (...skipping 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 * Initialize a newly created function body consisting of a block of | 3470 * Initialize a newly created function body consisting of a block of |
| 3471 * statements. The [keyword] can be `null` if there is no keyword specified | 3471 * statements. The [keyword] can be `null` if there is no keyword specified |
| 3472 * for the block. The [star] can be `null` if there is no star following the | 3472 * for the block. The [star] can be `null` if there is no star following the |
| 3473 * keyword (and must be `null` if there is no keyword). | 3473 * keyword (and must be `null` if there is no keyword). |
| 3474 */ | 3474 */ |
| 3475 BlockFunctionBody(this.keyword, this.star, Block block) { | 3475 BlockFunctionBody(this.keyword, this.star, Block block) { |
| 3476 _block = _becomeParentOf(block); | 3476 _block = _becomeParentOf(block); |
| 3477 } | 3477 } |
| 3478 | 3478 |
| 3479 @override | 3479 @override |
| 3480 Token get beginToken => _block.beginToken; | 3480 Token get beginToken { |
| 3481 if (keyword != null) { |
| 3482 return keyword; |
| 3483 } |
| 3484 return _block.beginToken; |
| 3485 } |
| 3481 | 3486 |
| 3482 /** | 3487 /** |
| 3483 * Return the block representing the body of the function. | 3488 * Return the block representing the body of the function. |
| 3484 */ | 3489 */ |
| 3485 Block get block => _block; | 3490 Block get block => _block; |
| 3486 | 3491 |
| 3487 /** | 3492 /** |
| 3488 * Set the block representing the body of the function to the given [block]. | 3493 * Set the block representing the body of the function to the given [block]. |
| 3489 */ | 3494 */ |
| 3490 void set block(Block block) { | 3495 void set block(Block block) { |
| (...skipping 16709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20200 } | 20205 } |
| 20201 | 20206 |
| 20202 @override | 20207 @override |
| 20203 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); | 20208 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); |
| 20204 | 20209 |
| 20205 @override | 20210 @override |
| 20206 void visitChildren(AstVisitor visitor) { | 20211 void visitChildren(AstVisitor visitor) { |
| 20207 _safelyVisitChild(_expression, visitor); | 20212 _safelyVisitChild(_expression, visitor); |
| 20208 } | 20213 } |
| 20209 } | 20214 } |
| OLD | NEW |