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

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

Issue 351283003: Move Tokenfactory, AstFactory and ElementFactory from tests to the testing/ Folder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/resolver.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/source.dart
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index e01f15fd9c37ab2971dba8ed41611ac5a6346a43..5e410f9979d6436de32fd8ebafb4684365579f1e 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -258,6 +258,59 @@ class LocalSourcePredicate_TRUE implements LocalSourcePredicate {
}
/**
+ * An implementation of an non-existing [Source].
+ */
+class NonExistingSource implements Source {
+ final String _name;
+
+ final UriKind uriKind;
+
+ NonExistingSource(this._name, this.uriKind);
+
+ @override
+ bool operator ==(Object obj) {
+ if (obj is NonExistingSource) {
+ NonExistingSource other = obj;
+ return other.uriKind == uriKind && (other._name == _name);
+ }
+ return false;
+ }
+
+ @override
+ bool exists() => false;
+
+ @override
+ TimestampedData<String> get contents {
+ throw new UnsupportedOperationException("${_name}does not exist.");
+ }
+
+ @override
+ String get encoding {
+ throw new UnsupportedOperationException("${_name}does not exist.");
+ }
+
+ @override
+ String get fullName => _name;
+
+ @override
+ int get modificationStamp => 0;
+
+ @override
+ String get shortName => _name;
+
+ @override
+ int get hashCode => _name.hashCode;
+
+ @override
+ bool get isInSystemLibrary => false;
+
+ @override
+ Source resolveRelative(Uri relativeUri) {
+ throw new UnsupportedOperationException("${_name}does not exist.");
+ }
+}
+
+/**
* The interface `Source` defines the behavior of objects representing source code that can be
* analyzed by the analysis engine.
*
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/source_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698