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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/excluding_transformer.dart

Issue 294123009: Make lazy and declaring transformers work with $include/$exclude. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: analyzer fixes Created 6 years, 7 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 | « no previous file | sdk/lib/_internal/pub/test/serve/supports_user_defined_declaring_transformers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/excluding_transformer.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/excluding_transformer.dart b/sdk/lib/_internal/pub/lib/src/barback/excluding_transformer.dart
index 0d9a9651cca857dd2050cb84b2ea3f25dc5c207c..9182ec6d48a3ee4efba22646dffb275a649e0619 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/excluding_transformer.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/excluding_transformer.dart
@@ -19,7 +19,15 @@ class ExcludingTransformer extends Transformer {
Set<String> excludes) {
if (includes == null && excludes == null) return inner;
- return new ExcludingTransformer._(inner, includes, excludes);
+ if (inner is LazyTransformer) {
+ return new _LazyExcludingTransformer(
+ inner as LazyTransformer, includes, excludes);
+ } else if (inner is DeclaringTransformer) {
+ return new _DeclaringExcludingTransformer(
+ inner as DeclaringTransformer, includes, excludes);
Bob Nystrom 2014/05/27 17:40:19 Based on my reading of the spec, these "as" expres
nweiz 2014/05/27 20:36:50 Done.
+ } else {
+ return new ExcludingTransformer._(inner, includes, excludes);
+ }
}
final Transformer _inner;
@@ -56,3 +64,20 @@ class ExcludingTransformer extends Transformer {
String toString() => _inner.toString();
}
+
+class _DeclaringExcludingTransformer extends ExcludingTransformer
+ implements DeclaringTransformer {
+ _DeclaringExcludingTransformer(DeclaringTransformer inner,
+ Set<String> includes, Set<String> excludes)
+ : super._(inner as Transformer, includes, excludes);
Bob Nystrom 2014/05/27 17:40:19 I know we discussed this, but I can't recall the d
nweiz 2014/05/27 20:36:50 I don't remember our original reason for not makin
+
+ Future declareOutputs(DeclaringTransform transform) =>
+ (_inner as DeclaringTransformer).declareOutputs(transform);
+}
+
+class _LazyExcludingTransformer extends _DeclaringExcludingTransformer
+ implements LazyTransformer {
+ _LazyExcludingTransformer(DeclaringTransformer inner,
+ Set<String> includes, Set<String> excludes)
+ : super(inner, includes, excludes);
+}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/serve/supports_user_defined_declaring_transformers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698