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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 830893003: Remove the Polymer support from the analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 39f96eeff4efdeab96c2a6ac8452553e55d925a1..c25e612d750032e580e3affa350d8a4f28164362 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -8510,16 +8510,6 @@ class LibraryResolver {
} finally {
timeCounter.stop();
}
- // Polymer
- timeCounter = PerformanceStatistics.polymer.start();
- try {
- for (Source source in library.compilationUnitSources) {
- CompilationUnit ast = library.getAST(source);
- new PolymerCompilationUnitBuilder(ast).build();
- }
- } finally {
- timeCounter.stop();
- }
}
/**
@@ -9073,16 +9063,6 @@ class LibraryResolver2 {
} finally {
timeCounter.stop();
}
- // Polymer
- timeCounter = PerformanceStatistics.polymer.start();
- try {
- for (Source source in library.compilationUnitSources) {
- CompilationUnit ast = library.getAST(source);
- new PolymerCompilationUnitBuilder(ast).build();
- }
- } finally {
- timeCounter.stop();
- }
}
/**
@@ -9761,113 +9741,6 @@ class OverrideVerifier extends RecursiveAstVisitor<Object> {
}
/**
- * Instances of the class `PolymerCompilationUnitBuilder` build a Polymer specific element
- * model for a single compilation unit.
- */
-class PolymerCompilationUnitBuilder {
- static String _CUSTOM_TAG = "CustomTag";
-
- /**
- * The compilation unit with built Dart element models.
- */
- final CompilationUnit _unit;
-
- /**
- * The [ClassDeclaration] that is currently being analyzed.
- */
- ClassDeclaration _classDeclaration;
-
- /**
- * The [ClassElementImpl] that is currently being analyzed.
- */
- ClassElementImpl _classElement;
-
- /**
- * The [Annotation] that is currently being analyzed.
- */
- Annotation _annotation;
-
- /**
- * Initialize a newly created compilation unit element builder.
- *
- * @param unit the compilation unit with built Dart element models
- */
- PolymerCompilationUnitBuilder(this._unit);
-
- /**
- * Builds Polymer specific element models and adds them to the existing Dart elements.
- */
- void build() {
- // process classes
- for (CompilationUnitMember unitMember in _unit.declarations) {
- if (unitMember is ClassDeclaration) {
- this._classDeclaration = unitMember;
- this._classElement = _classDeclaration.element as ClassElementImpl;
- // process annotations
- NodeList<Annotation> annotations = _classDeclaration.metadata;
- for (Annotation annotation in annotations) {
- // verify annotation
- if (annotation.arguments == null) {
- continue;
- }
- this._annotation = annotation;
- // @CustomTag
- if (_isAnnotation(annotation, _CUSTOM_TAG)) {
- _parseCustomTag();
- continue;
- }
- }
- }
- }
- }
-
- /**
- * Checks if given [Annotation] is an annotation with required name.
- */
- bool _isAnnotation(Annotation annotation, String name) {
- Element element = annotation.element;
- if (element is ConstructorElement) {
- ConstructorElement constructorElement = element;
- return constructorElement.returnType.displayName == name;
- }
- return false;
- }
-
- void _parseCustomTag() {
- List<Expression> arguments = _annotation.arguments.arguments;
- if (arguments.length == 1) {
- Expression nameExpression = arguments[0];
- if (nameExpression is SimpleStringLiteral) {
- SimpleStringLiteral nameLiteral = nameExpression;
- String name = nameLiteral.value;
- int nameOffset = nameLiteral.contentsOffset;
- PolymerTagDartElementImpl element =
- new PolymerTagDartElementImpl(name, nameOffset, _classElement);
- _classElement.addToolkitObjects(element);
- nameLiteral.toolkitElement = element;
- }
- }
- }
-
- static Element getElement(AstNode node, int offset) {
- // maybe node is not SimpleStringLiteral
- if (node is! SimpleStringLiteral) {
- return null;
- }
- SimpleStringLiteral literal = node as SimpleStringLiteral;
- // maybe has PolymerElement
- {
- Element element = literal.toolkitElement;
- if (element is PolymerElement) {
- return element;
- }
- }
- // no Element
- return null;
- }
-}
-
-/**
* Instances of the class `PubVerifier` traverse an AST structure looking for deviations from
* pub best practices.
*/
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698