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/visitor.dart'; | 11 import 'package:analyzer/dart/ast/visitor.dart'; |
11 import 'package:analyzer/dart/element/element.dart'; | 12 import 'package:analyzer/dart/element/element.dart'; |
| 13 import 'package:analyzer/src/dart/ast/token.dart'; |
12 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine; | 14 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine; |
13 import 'package:analyzer/src/generated/java_core.dart'; | 15 import 'package:analyzer/src/generated/java_core.dart'; |
14 import 'package:analyzer/src/generated/java_engine.dart'; | 16 import 'package:analyzer/src/generated/java_engine.dart'; |
15 import 'package:analyzer/src/generated/scanner.dart'; | |
16 import 'package:analyzer/src/generated/utilities_collection.dart' show TokenMap; | 17 import 'package:analyzer/src/generated/utilities_collection.dart' show TokenMap; |
17 import 'package:analyzer/src/generated/utilities_dart.dart'; | 18 import 'package:analyzer/src/generated/utilities_dart.dart'; |
18 | 19 |
19 /** | 20 /** |
20 * An AST visitor that will clone any AST structure that it visits. The cloner | 21 * An AST visitor that will clone any AST structure that it visits. The cloner |
21 * will only clone the structure, it will not preserve any resolution results or | 22 * will only clone the structure, it will not preserve any resolution results or |
22 * properties associated with the nodes. | 23 * properties associated with the nodes. |
23 */ | 24 */ |
24 class AstCloner implements AstVisitor<AstNode> { | 25 class AstCloner implements AstVisitor<AstNode> { |
25 /** | 26 /** |
(...skipping 6316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6342 * Safely visit the given [token], printing the [suffix] after the token if it | 6343 * Safely visit the given [token], printing the [suffix] after the token if it |
6343 * is non-`null`. | 6344 * is non-`null`. |
6344 */ | 6345 */ |
6345 void _visitTokenWithSuffix(Token token, String suffix) { | 6346 void _visitTokenWithSuffix(Token token, String suffix) { |
6346 if (token != null) { | 6347 if (token != null) { |
6347 _writer.print(token.lexeme); | 6348 _writer.print(token.lexeme); |
6348 _writer.print(suffix); | 6349 _writer.print(suffix); |
6349 } | 6350 } |
6350 } | 6351 } |
6351 } | 6352 } |
OLD | NEW |