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 analyzer.src.dart.ast.utilities; | 5 library analyzer.src.dart.ast.utilities; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 7185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7196 return null; | 7196 return null; |
7197 } | 7197 } |
7198 | 7198 |
7199 @override | 7199 @override |
7200 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { | 7200 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { |
7201 _visitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' '); | 7201 _visitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' '); |
7202 _visitNodeWithSuffix(node.returnType, " "); | 7202 _visitNodeWithSuffix(node.returnType, " "); |
7203 _visitNode(node.identifier); | 7203 _visitNode(node.identifier); |
7204 _visitNode(node.typeParameters); | 7204 _visitNode(node.typeParameters); |
7205 _visitNode(node.parameters); | 7205 _visitNode(node.parameters); |
| 7206 if (node.question != null) { |
| 7207 _writer.print('?'); |
| 7208 } |
7206 return null; | 7209 return null; |
7207 } | 7210 } |
7208 | 7211 |
7209 @override | 7212 @override |
7210 Object visitHideCombinator(HideCombinator node) { | 7213 Object visitHideCombinator(HideCombinator node) { |
7211 _writer.print("hide "); | 7214 _writer.print("hide "); |
7212 _visitNodeListWithSeparator(node.hiddenNames, ", "); | 7215 _visitNodeListWithSeparator(node.hiddenNames, ", "); |
7213 return null; | 7216 return null; |
7214 } | 7217 } |
7215 | 7218 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7642 _writer.print('<'); | 7645 _writer.print('<'); |
7643 _visitNodeListWithSeparator(node.arguments, ", "); | 7646 _visitNodeListWithSeparator(node.arguments, ", "); |
7644 _writer.print('>'); | 7647 _writer.print('>'); |
7645 return null; | 7648 return null; |
7646 } | 7649 } |
7647 | 7650 |
7648 @override | 7651 @override |
7649 Object visitTypeName(TypeName node) { | 7652 Object visitTypeName(TypeName node) { |
7650 _visitNode(node.name); | 7653 _visitNode(node.name); |
7651 _visitNode(node.typeArguments); | 7654 _visitNode(node.typeArguments); |
| 7655 if (node.question != null) { |
| 7656 _writer.print('?'); |
| 7657 } |
7652 return null; | 7658 return null; |
7653 } | 7659 } |
7654 | 7660 |
7655 @override | 7661 @override |
7656 Object visitTypeParameter(TypeParameter node) { | 7662 Object visitTypeParameter(TypeParameter node) { |
7657 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " "); | 7663 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " "); |
7658 _visitNode(node.name); | 7664 _visitNode(node.name); |
7659 _visitNodeWithPrefix(" extends ", node.bound); | 7665 _visitNodeWithPrefix(" extends ", node.bound); |
7660 return null; | 7666 return null; |
7661 } | 7667 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7828 * Safely visit the given [token], printing the [suffix] after the token if it | 7834 * Safely visit the given [token], printing the [suffix] after the token if it |
7829 * is non-`null`. | 7835 * is non-`null`. |
7830 */ | 7836 */ |
7831 void _visitTokenWithSuffix(Token token, String suffix) { | 7837 void _visitTokenWithSuffix(Token token, String suffix) { |
7832 if (token != null) { | 7838 if (token != null) { |
7833 _writer.print(token.lexeme); | 7839 _writer.print(token.lexeme); |
7834 _writer.print(suffix); | 7840 _writer.print(suffix); |
7835 } | 7841 } |
7836 } | 7842 } |
7837 } | 7843 } |
OLD | NEW |