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

Unified Diff: packages/analyzer/lib/src/dart/element/utilities.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 5 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: packages/analyzer/lib/src/dart/element/utilities.dart
diff --git a/packages/analyzer/lib/src/dart/element/utilities.dart b/packages/analyzer/lib/src/dart/element/utilities.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7c5aa4cece13c9975adc96fe90d51dc2bb05fe6b
--- /dev/null
+++ b/packages/analyzer/lib/src/dart/element/utilities.dart
@@ -0,0 +1,34 @@
+// 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 analyzer.src.dart.element.utilities;
+
+import 'dart:collection';
+
+import 'package:analyzer/dart/element/element.dart';
+import 'package:analyzer/dart/element/visitor.dart';
+
+/**
+ * A visitor that can be used to collect all of the non-synthetic elements in an
+ * element model.
+ */
+class ElementGatherer extends GeneralizingElementVisitor {
+ /**
+ * The set in which the elements are collected.
+ */
+ final Set<Element> elements = new HashSet<Element>();
+
+ /**
+ * Initialize the visitor.
+ */
+ ElementGatherer();
+
+ @override
+ void visitElement(Element element) {
+ if (!element.isSynthetic) {
+ elements.add(element);
+ }
+ super.visitElement(element);
+ }
+}
« no previous file with comments | « packages/analyzer/lib/src/dart/element/type.dart ('k') | packages/analyzer/lib/src/dart/error/syntactic_errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698