| 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 engine.ast.visitors; | 5 library engine.ast.visitors; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 | 8 |
| 9 | |
| 10 /// An [AstVisitor] that delegates calls to visit methods to all [delegates] | 9 /// An [AstVisitor] that delegates calls to visit methods to all [delegates] |
| 11 /// before calling [visitChildren]. | 10 /// before calling [visitChildren]. |
| 12 class DelegatingAstVisitor<T> implements AstVisitor<T> { | 11 class DelegatingAstVisitor<T> implements AstVisitor<T> { |
| 13 | 12 |
| 14 Iterable<AstVisitor<T>> _delegates; | 13 Iterable<AstVisitor<T>> _delegates; |
| 15 DelegatingAstVisitor(this._delegates); | 14 DelegatingAstVisitor(this._delegates); |
| 16 | 15 |
| 17 @override | 16 @override |
| 18 T visitAdjacentStrings(AdjacentStrings node) { | 17 T visitAdjacentStrings(AdjacentStrings node) { |
| 19 _delegates.forEach((delegate) => delegate.visitAdjacentStrings(node)); | 18 _delegates.forEach((delegate) => delegate.visitAdjacentStrings(node)); |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 return null; | 762 return null; |
| 764 } | 763 } |
| 765 | 764 |
| 766 @override | 765 @override |
| 767 T visitYieldStatement(YieldStatement node) { | 766 T visitYieldStatement(YieldStatement node) { |
| 768 _delegates.forEach((delegate) => delegate.visitYieldStatement(node)); | 767 _delegates.forEach((delegate) => delegate.visitYieldStatement(node)); |
| 769 node.visitChildren(this); | 768 node.visitChildren(this); |
| 770 return null; | 769 return null; |
| 771 } | 770 } |
| 772 } | 771 } |
| OLD | NEW |