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

Side by Side Diff: pkg/analyzer_experimental/lib/src/string_source.dart

Issue 45573002: Rename analyzer_experimental to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks before publishing. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library analyzer.string_source;
6
7 import 'generated/source.dart';
8
9 /// An implementation of [Source] that's based on an in-memory Dart string.
10 class StringSource implements Source {
11 final String _contents;
12 final String fullName;
13 final int modificationStamp;
14
15 StringSource(this._contents, this.fullName)
16 : modificationStamp = new DateTime.now().millisecondsSinceEpoch;
17
18 bool operator==(Object object) {
19 if (object is StringSource) {
20 StringSource ssObject = object;
21 return ssObject._contents == _contents && ssObject.fullName == fullName;
22 }
23 return false;
24 }
25
26 bool exists() => true;
27
28 void getContents(Source_ContentReceiver receiver) =>
29 receiver.accept2(_contents, modificationStamp);
30
31 String get encoding => throw new UnsupportedError("StringSource doesn't suppor t "
32 "encoding.");
33
34 String get shortName => fullName;
35
36 UriKind get uriKind => throw new UnsupportedError("StringSource doesn't suppor t "
37 "uriKind.");
38
39 int get hashCode => _contents.hashCode ^ fullName.hashCode;
40
41 bool get isInSystemLibrary => false;
42
43 Source resolveRelative(Uri relativeUri) => throw new UnsupportedError(
44 "StringSource doesn't support resolveRelative.");
45 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/services/writer.dart ('k') | pkg/analyzer_experimental/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698