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

Side by Side 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: RegExp used for line numbers 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #library('mirrors'); 5 #library('mirrors');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('dart:uri'); 8 #import('dart:uri');
9 9
10 // TODO(rnystrom): Use "package:" URL (#4968). 10 // TODO(rnystrom): Use "package:" URL (#4968).
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 bool get isInitializingFormal; 556 bool get isInitializingFormal;
557 557
558 /** 558 /**
559 * Returns the initialized field, if this parameter is an initializing formal. 559 * Returns the initialized field, if this parameter is an initializing formal.
560 */ 560 */
561 VariableMirror get initializedField; 561 VariableMirror get initializedField;
562 } 562 }
563 563
564 /** 564 /**
565 * A [SourceLocation] describes the span of an entity in Dart source code. 565 * A [SourceLocation] describes the span of an entity in Dart source code.
566 * A [SourceLocation] should be the minimum span that encloses the declaration 566 * A [SourceLocation] with a non-zero [length] should be the minimum span that
567 * of the mirrored entity. 567 * encloses the declaration of the mirrored entity.
568 */ 568 */
569 abstract class SourceLocation { 569 abstract class SourceLocation {
570 /** 570 /**
571 * The character position where the location begins. 571 * The 1-based line number for this source location.
572 *
573 * A value of 0 means that the line number is unknown.
572 */ 574 */
573 int get start; 575 int get line;
574 576
575 /** 577 /**
576 * The character position where the location ends. 578 * The 1-based column number for this source location.
579 *
580 * A value of 0 means that the column number is unknown.
577 */ 581 */
578 int get end; 582 int get column;
579 583
580 /** 584 /**
581 * Returns the [Source] in which this [SourceLocation] indexes. 585 * The 0-based character offset into the [sourceText] where this source
582 * If [:loc:] is a location, [:loc.source().text()[loc.start]:] is where it 586 * location begins.
583 * starts, and [:loc.source().text()[loc.end]:] is where it ends. 587 *
588 * A value of -1 means that the offset is unknown.
584 */ 589 */
585 Source get source; 590 int get offset;
591
592 /**
593 * The number of characters in this source location.
594 *
595 * A value of 0 means that the [offset] is approximate.
596 */
597 int get length;
586 598
587 /** 599 /**
588 * The text of the location span. 600 * The text of the location span.
589 */ 601 */
590 String get text; 602 String get text;
591 }
592 603
593 /**
594 * A [Source] describes the source code of a compilation unit in Dart source
595 * code.
596 */
597 abstract class Source {
598 /** 604 /**
599 * Returns the URI where the source originated. 605 * Returns the URI where the source originated.
600 */ 606 */
601 Uri get uri; 607 Uri get sourceUri;
602 608
603 /** 609 /**
604 * Returns the text of this source. 610 * Returns the text of this source.
605 */ 611 */
606 String get text; 612 String get sourceText;
607 } 613 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698