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

Unified Diff: pkg/compiler/lib/src/io/code_output.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/elements/elements.dart ('k') | pkg/compiler/lib/src/io/line_column_provider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/io/code_output.dart
diff --git a/pkg/compiler/lib/src/io/code_output.dart b/pkg/compiler/lib/src/io/code_output.dart
index 1b4075da61454b089f09f0e540131096ff0f6370..967de65c7d77640ab38df5ce4445c471b6bc5aa2 100644
--- a/pkg/compiler/lib/src/io/code_output.dart
+++ b/pkg/compiler/lib/src/io/code_output.dart
@@ -8,12 +8,26 @@ import 'dart:async';
import 'source_information.dart';
+/// Listener interface for [CodeOutput] activity.
abstract class CodeOutputListener {
+ /// Called when [text] is added to the output.
void onText(String text);
+
+ /// Called when the output is closed with a final length of [length].
void onDone(int length);
}
-abstract class CodeOutput {
+/// Interface for a mapping of target offsets to source locations.
+abstract class SourceLocations {
+ /// Adds a [sourceLocation] at the specified [targetOffset].
+ void addSourceLocation(int targetOffset, SourceLocation sourcePosition);
+
+ /// Applies [f] to every target offset and associated source location.
+ void forEachSourceLocation(void f(int targetOffset,
+ SourceLocation sourceLocation));
+}
+
+abstract class CodeOutput implements SourceLocations {
/// Write [text] to this output.
///
/// If the output is closed, a [StateError] is thrown.
@@ -33,13 +47,6 @@ abstract class CodeOutput {
/// Closes the output. Further writes will cause a [StateError].
void close();
-
- /// Adds a [sourceLocation] at the specified [targetOffset] in the buffer.
- void addSourceLocation(int targetOffset, SourceLocation sourcePosition);
-
- /// Applies [f] to every marker in this output.
- void forEachSourceLocation(void f(int targetOffset,
- SourceLocation sourceLocation));
}
abstract class AbstractCodeOutput extends CodeOutput {
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/io/line_column_provider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698