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

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

Issue 214593008: Rollback pkg/analyzer that breaks code_transformers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/sdk_io.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 4a31c59b5a4e8198925cf8e63e948db035aea0bc..446c8eaa27ded1992da4d0430b85ebc73958f686 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -69,7 +69,7 @@ class SourceFactory {
/**
* The resolvers used to resolve absolute URI's.
*/
- final List<UriResolver> _resolvers;
+ List<UriResolver> _resolvers;
/**
* The predicate to determine is [Source] is local.
@@ -81,7 +81,9 @@ class SourceFactory {
*
* @param resolvers the resolvers used to resolve absolute URI's
*/
- SourceFactory(this._resolvers);
+ SourceFactory(List<UriResolver> resolvers) {
+ this._resolvers = resolvers;
+ }
/**
* Return a source object representing the given absolute URI, or `null` if the URI is not a
@@ -416,29 +418,29 @@ class SourceKind extends Enum<SourceKind> {
/**
* A source containing HTML. The HTML might or might not contain Dart scripts.
*/
- static const SourceKind HTML = const SourceKind('HTML', 0);
+ static final SourceKind HTML = new SourceKind('HTML', 0);
/**
* A Dart compilation unit that is not a part of another library. Libraries might or might not
* contain any directives, including a library directive.
*/
- static const SourceKind LIBRARY = const SourceKind('LIBRARY', 1);
+ static final SourceKind LIBRARY = new SourceKind('LIBRARY', 1);
/**
* A Dart compilation unit that is part of another library. Parts contain a part-of directive.
*/
- static const SourceKind PART = const SourceKind('PART', 2);
+ static final SourceKind PART = new SourceKind('PART', 2);
/**
* An unknown kind of source. Used both when it is not possible to identify the kind of a source
* and also when the kind of a source is not known without performing a computation and the client
* does not want to spend the time to identify the kind.
*/
- static const SourceKind UNKNOWN = const SourceKind('UNKNOWN', 3);
+ static final SourceKind UNKNOWN = new SourceKind('UNKNOWN', 3);
- static const List<SourceKind> values = const [HTML, LIBRARY, PART, UNKNOWN];
+ static final List<SourceKind> values = [HTML, LIBRARY, PART, UNKNOWN];
- const SourceKind(String name, int ordinal) : super(name, ordinal);
+ SourceKind(String name, int ordinal) : super(name, ordinal);
}
/**
@@ -449,24 +451,24 @@ class UriKind extends Enum<UriKind> {
/**
* A 'dart:' URI.
*/
- static const UriKind DART_URI = const UriKind('DART_URI', 0, 0x64);
+ static final UriKind DART_URI = new UriKind('DART_URI', 0, 0x64);
/**
* A 'file:' URI.
*/
- static const UriKind FILE_URI = const UriKind('FILE_URI', 1, 0x66);
+ static final UriKind FILE_URI = new UriKind('FILE_URI', 1, 0x66);
/**
* A 'package:' URI referencing source package itself.
*/
- static const UriKind PACKAGE_SELF_URI = const UriKind('PACKAGE_SELF_URI', 2, 0x73);
+ static final UriKind PACKAGE_SELF_URI = new UriKind('PACKAGE_SELF_URI', 2, 0x73);
/**
* A 'package:' URI.
*/
- static const UriKind PACKAGE_URI = const UriKind('PACKAGE_URI', 3, 0x70);
+ static final UriKind PACKAGE_URI = new UriKind('PACKAGE_URI', 3, 0x70);
- static const List<UriKind> values = const [DART_URI, FILE_URI, PACKAGE_SELF_URI, PACKAGE_URI];
+ static final List<UriKind> values = [DART_URI, FILE_URI, PACKAGE_SELF_URI, PACKAGE_URI];
/**
* Return the URI kind represented by the given encoding, or `null` if there is no kind with
@@ -494,14 +496,16 @@ class UriKind extends Enum<UriKind> {
/**
* The single character encoding used to identify this kind of URI.
*/
- final int encoding;
+ int encoding = 0;
/**
* Initialize a newly created URI kind to have the given encoding.
*
* @param encoding the single character encoding used to identify this kind of URI.
*/
- const UriKind(String name, int ordinal, this.encoding) : super(name, ordinal);
+ UriKind(String name, int ordinal, int encoding) : super(name, ordinal) {
+ this.encoding = encoding;
+ }
}
/**
@@ -517,13 +521,13 @@ class SourceRange {
* The 0-based index of the first character of the source code for this element, relative to the
* source buffer in which this element is contained.
*/
- final int offset;
+ int offset = 0;
/**
* The number of characters of the source code for this element, relative to the source buffer in
* which this element is contained.
*/
- final int length;
+ int length = 0;
/**
* Initialize a newly created source range using the given offset and the given length.
@@ -531,7 +535,10 @@ class SourceRange {
* @param offset the given offset
* @param length the given length
*/
- SourceRange(this.offset, this.length);
+ SourceRange(int offset, int length) {
+ this.offset = offset;
+ this.length = length;
+ }
/**
* @return `true` if <code>x</code> is in [offset, offset + length) interval.
@@ -650,17 +657,9 @@ abstract class SourceContainer {
*/
class DartUriResolver extends UriResolver {
/**
- * Return `true` if the given URI is a `dart-ext:` URI.
- *
- * @param uriContent the textual representation of the URI being tested
- * @return `true` if the given URI is a `dart-ext:` URI
- */
- static bool isDartExtUri(String uriContent) => uriContent != null && uriContent.startsWith(_DART_EXT_SCHEME);
-
- /**
* The Dart SDK against which URI's are to be resolved.
*/
- final DartSdk _sdk;
+ DartSdk _sdk;
/**
* The name of the `dart` scheme.
@@ -668,11 +667,6 @@ class DartUriResolver extends UriResolver {
static String _DART_SCHEME = "dart";
/**
- * The prefix of a URI using the dart-ext scheme to reference a native code library.
- */
- static String _DART_EXT_SCHEME = "dart-ext:";
-
- /**
* Return `true` if the given URI is a `dart:` URI.
*
* @param uri the URI being tested
@@ -686,7 +680,9 @@ class DartUriResolver extends UriResolver {
*
* @param sdk the Dart SDK against which URI's are to be resolved
*/
- DartUriResolver(this._sdk);
+ DartUriResolver(DartSdk sdk) {
+ this._sdk = sdk;
+ }
@override
Source fromEncoding(UriKind kind, Uri uri) {
@@ -720,7 +716,7 @@ class LineInfo {
/**
* An array containing the offsets of the first character of each line in the source code.
*/
- final List<int> _lineStarts;
+ List<int> _lineStarts;
/**
* Initialize a newly created set of line information to represent the data encoded in the given
@@ -728,12 +724,13 @@ class LineInfo {
*
* @param lineStarts the offsets of the first character of each line in the source code
*/
- LineInfo(this._lineStarts) {
- if (_lineStarts == null) {
+ LineInfo(List<int> lineStarts) {
+ if (lineStarts == null) {
throw new IllegalArgumentException("lineStarts must be non-null");
- } else if (_lineStarts.length < 1) {
+ } else if (lineStarts.length < 1) {
throw new IllegalArgumentException("lineStarts must be non-empty");
}
+ this._lineStarts = lineStarts;
}
/**
@@ -761,12 +758,12 @@ class LineInfo_Location {
/**
* The one-based index of the line containing the character.
*/
- final int lineNumber;
+ int lineNumber = 0;
/**
* The one-based index of the column containing the character.
*/
- final int columnNumber;
+ int columnNumber = 0;
/**
* Initialize a newly created location to represent the location of the character at the given
@@ -775,7 +772,10 @@ class LineInfo_Location {
* @param lineNumber the one-based index of the line containing the character
* @param columnNumber the one-based index of the column containing the character
*/
- LineInfo_Location(this.lineNumber, this.columnNumber);
+ LineInfo_Location(int lineNumber, int columnNumber) {
+ this.lineNumber = lineNumber;
+ this.columnNumber = columnNumber;
+ }
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/sdk_io.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