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

Unified Diff: pkg/compiler/lib/src/source_file.dart

Issue 812233004: Add CodeOutput to prepare for emission without in-memory buffers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/compiler/lib/src/source_file.dart
diff --git a/pkg/compiler/lib/src/source_file.dart b/pkg/compiler/lib/src/source_file.dart
index b3566385a97c23f3af4281cb9568f42863b10e54..ad92b4626bcf42993a632a8eddcb1bcb5fbaaa7c 100644
--- a/pkg/compiler/lib/src/source_file.dart
+++ b/pkg/compiler/lib/src/source_file.dart
@@ -7,11 +7,20 @@ library source_file;
import 'dart:math';
import 'dart:convert' show UTF8;
+/// Interface for providing line/column information.
+abstract class LineColumnProvider {
+ /// Returns the line number (0-based) for [offset].
+ int getLine(int offset);
+
+ /// Returns the column number (0-based) for [offset] at the given [line].
+ int getColumn(int line, int offset);
+}
+
/**
* Represents a file of source code. The content can be either a [String] or
* a UTF-8 encoded [List<int>] of bytes.
*/
-abstract class SourceFile {
+abstract class SourceFile implements LineColumnProvider {
/** The name of the file. */
String get filename;

Powered by Google App Engine
This is Rietveld 408576698