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

Unified Diff: pkg/dartdoc/lib/mirrors.dart

Issue 11275097: Merge SourceLocation and Source (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/dartdoc/lib/mirrors.dart
diff --git a/pkg/dartdoc/lib/mirrors.dart b/pkg/dartdoc/lib/mirrors.dart
index ece50b396ef39f6dd01653da004cf17f03a5991d..7e0bf19c7303ce176e84b07b97b3113ac447ac3c 100644
--- a/pkg/dartdoc/lib/mirrors.dart
+++ b/pkg/dartdoc/lib/mirrors.dart
@@ -563,45 +563,51 @@ abstract class ParameterMirror implements VariableMirror {
/**
* A [SourceLocation] describes the span of an entity in Dart source code.
- * A [SourceLocation] should be the minimum span that encloses the declaration
- * of the mirrored entity.
+ * A [SourceLocation] with a non-zero [length] should be the minimum span that
+ * encloses the declaration of the mirrored entity.
*/
abstract class SourceLocation {
/**
- * The character position where the location begins.
+ * The 1-based line number for this source location.
+ *
+ * A value of 0 means that the line number is unknown.
+ */
+ int get line;
+
+ /**
+ * The 1-based column number for this source location.
+ *
+ * A value of 0 means that the column number is unknown.
*/
- int get start;
+ int get column;
/**
- * The character position where the location ends.
+ * The 0-based character offset into the [sourceText] where this source
+ * location begins.
+ *
+ * A value of -1 means that the offset is unknown.
*/
- int get end;
+ int get offset;
/**
- * Returns the [Source] in which this [SourceLocation] indexes.
- * If [:loc:] is a location, [:loc.source().text()[loc.start]:] is where it
- * starts, and [:loc.source().text()[loc.end]:] is where it ends.
+ * The number of characters in this source location.
+ *
+ * A value of 0 means that the [offset] is approximate.
*/
- Source get source;
+ int get length;
/**
* The text of the location span.
*/
String get text;
-}
-/**
- * A [Source] describes the source code of a compilation unit in Dart source
- * code.
- */
-abstract class Source {
/**
* Returns the URI where the source originated.
*/
- Uri get uri;
+ Uri get sourceUri;
/**
* Returns the text of this source.
*/
- String get text;
+ String get sourceText;
}

Powered by Google App Engine
This is Rietveld 408576698