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

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

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/source_information.dart ('k') | pkg/compiler/lib/src/io/start_end_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/source_map_builder.dart
diff --git a/pkg/compiler/lib/src/io/source_map_builder.dart b/pkg/compiler/lib/src/io/source_map_builder.dart
index 28b52a525240e8a5787b32937944c67dd7ac9921..f6fa4780ec441c68c97dbebafc25ac4712154e23 100644
--- a/pkg/compiler/lib/src/io/source_map_builder.dart
+++ b/pkg/compiler/lib/src/io/source_map_builder.dart
@@ -10,18 +10,17 @@ import 'line_column_provider.dart';
import 'source_information.dart' show SourceLocation;
class SourceMapBuilder {
-
/// The URI of the source map file.
final Uri sourceMapUri;
+
/// The URI of the target language file.
final Uri targetFileUri;
final LineColumnProvider lineColumnProvider;
final List<SourceMapEntry> entries = new List<SourceMapEntry>();
- SourceMapBuilder(this.sourceMapUri,
- this.targetFileUri,
- this.lineColumnProvider);
+ SourceMapBuilder(
+ this.sourceMapUri, this.targetFileUri, this.lineColumnProvider);
void addMapping(int targetOffset, SourceLocation sourceLocation) {
entries.add(new SourceMapEntry(sourceLocation, targetOffset));
@@ -41,7 +40,6 @@ class SourceMapBuilder {
}
String build() {
-
LineColumnMap<SourceMapEntry> lineColumnMap =
new LineColumnMap<SourceMapEntry>();
Map<Uri, LineColumnMap<SourceMapEntry>> sourceLocationMap =
@@ -55,8 +53,8 @@ class SourceMapBuilder {
SourceLocation location = sourceMapEntry.sourceLocation;
if (location != null) {
LineColumnMap<SourceMapEntry> sourceLineColumnMap =
- sourceLocationMap.putIfAbsent(location.sourceUri,
- () => new LineColumnMap<SourceMapEntry>());
+ sourceLocationMap.putIfAbsent(
+ location.sourceUri, () => new LineColumnMap<SourceMapEntry>());
sourceLineColumnMap.add(location.line, location.column, sourceMapEntry);
}
});
@@ -92,8 +90,8 @@ class SourceMapBuilder {
buffer.write(' "sources": ');
Iterable<String> relativeSourceUriList = const <String>[];
if (sourceMapUri != null) {
- relativeSourceUriList = uriMap.elements
- .map((u) => relativize(sourceMapUri, u, false));
+ relativeSourceUriList =
+ uriMap.elements.map((u) => relativize(sourceMapUri, u, false));
}
printStringListOn(relativeSourceUriList, buffer);
buffer.write(',\n');
@@ -106,10 +104,8 @@ class SourceMapBuilder {
return buffer.toString();
}
- void writeEntries(LineColumnMap<SourceMapEntry> entries,
- IndexMap<Uri> uriMap,
- IndexMap<String> nameMap,
- StringBuffer output) {
+ void writeEntries(LineColumnMap<SourceMapEntry> entries, IndexMap<Uri> uriMap,
+ IndexMap<String> nameMap, StringBuffer output) {
SourceLocation previousSourceLocation;
int previousTargetLine = 0;
DeltaEncoder targetColumnEncoder = new DeltaEncoder();
@@ -119,9 +115,7 @@ class SourceMapBuilder {
DeltaEncoder sourceColumnEncoder = new DeltaEncoder();
DeltaEncoder sourceNameIndexEncoder = new DeltaEncoder();
- entries.forEach((int targetLine,
- int targetColumn,
- SourceMapEntry entry) {
+ entries.forEach((int targetLine, int targetColumn, SourceMapEntry entry) {
SourceLocation sourceLocation = entry.sourceLocation;
if (sourceLocation == previousSourceLocation) {
return;
@@ -184,7 +178,7 @@ class DeltaEncoder {
static const int VLQ_CONTINUATION_BIT = 1 << 5;
static const int VLQ_CONTINUATION_MASK = 1 << 5;
static const String BASE64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmn'
- 'opqrstuvwxyz0123456789+/';
+ 'opqrstuvwxyz0123456789+/';
/// Writes the VLQ of delta between [value] and [offset] into [output] and
/// return [value].
« no previous file with comments | « pkg/compiler/lib/src/io/source_information.dart ('k') | pkg/compiler/lib/src/io/start_end_information.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698