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

Unified Diff: pkg/compiler/lib/src/io/line_column_provider.dart

Issue 1196433002: Create and test source mapping for invocations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 6 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
Index: pkg/compiler/lib/src/io/line_column_provider.dart
diff --git a/pkg/compiler/lib/src/io/line_column_provider.dart b/pkg/compiler/lib/src/io/line_column_provider.dart
index 4d17583fb9f5b972cf93b2dbf67c7811e4b4faa9..590e4e2a8215006494c9997753fbc81611a5ebe5 100644
--- a/pkg/compiler/lib/src/io/line_column_provider.dart
+++ b/pkg/compiler/lib/src/io/line_column_provider.dart
@@ -13,6 +13,9 @@ abstract class LineColumnProvider {
/// Returns the column number (0-based) for [offset] at the given [line].
int getColumn(int line, int offset);
+
+ /// Returns the offset for 0-based [line] and [column] numbers.
+ int getOffset(int line, int column);
}
/// [CodeOutputListener] that collects line information.
@@ -65,6 +68,8 @@ class LineColumnCollector extends CodeOutputListener
return offset - lineStarts[line];
}
+ int getOffset(int line, int column) => lineStarts[line] + column;
+
@override
void onDone(int length) {
lineStarts.add(length + 1);

Powered by Google App Engine
This is Rietveld 408576698