Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: pkg/analysis_services/lib/search/element_visitors.dart

Issue 484733003: Import analysis_services.dart into analysis_server.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_services/lib/search/element_visitors.dart
diff --git a/pkg/analysis_services/lib/search/element_visitors.dart b/pkg/analysis_services/lib/search/element_visitors.dart
deleted file mode 100644
index 6490caede534c042a1aabd9c5bf88286c6ae6d2c..0000000000000000000000000000000000000000
--- a/pkg/analysis_services/lib/search/element_visitors.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library services.search.element_visitors;
-
-import 'package:analyzer/src/generated/element.dart';
-
-
-/**
- * Uses [processor] to visit all of the children of [element].
- * If [processor] returns `true`, then children of a child are visited too.
- */
-void visitChildren(Element element, ElementProcessor processor) {
- element.visitChildren(new _ElementVisitorAdapter(processor));
-}
-
-
-/**
- * Uses [processor] to visit all of the top-level elements of [library].
- */
-void visitLibraryTopLevelElements(LibraryElement library,
- ElementProcessor processor) {
- library.visitChildren(new _TopLevelElementsVisitor(processor));
-}
-
-
-/**
- * An [Element] processor function type.
- * If `true` is returned, children of [element] will be visited.
- */
-typedef bool ElementProcessor(Element element);
-
-
-/**
- * A [GeneralizingElementVisitor] adapter for [ElementProcessor].
- */
-class _ElementVisitorAdapter extends GeneralizingElementVisitor {
- final ElementProcessor processor;
-
- _ElementVisitorAdapter(this.processor);
-
- @override
- void visitElement(Element element) {
- bool visitChildren = processor(element);
- if (visitChildren == true) {
- element.visitChildren(this);
- }
- }
-}
-
-
-/**
- * A [GeneralizingElementVisitor] for visiting top-level elements.
- */
-class _TopLevelElementsVisitor extends GeneralizingElementVisitor {
- final ElementProcessor processor;
-
- _TopLevelElementsVisitor(this.processor);
-
- @override
- void visitElement(Element element) {
- if (element is CompilationUnitElement) {
- element.visitChildren(this);
- } else {
- processor(element);
- }
- }
-}
« no previous file with comments | « pkg/analysis_services/lib/refactoring/refactoring.dart ('k') | pkg/analysis_services/lib/search/hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698