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

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: Rebased 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
« no previous file with comments | « pkg/compiler/lib/src/io/code_output.dart ('k') | pkg/compiler/lib/src/io/position_information.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fb3d5db513e9a41280cd97e5e8330263faca3a73..e8665fbd6b0b096564727ea2d76931939f8cf0ab 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);
« no previous file with comments | « pkg/compiler/lib/src/io/code_output.dart ('k') | pkg/compiler/lib/src/io/position_information.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698