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

Side by Side Diff: lib/builder.dart

Issue 12937009: renaming File to Source (Closed) Base URL: git@github.com:dart-lang/source-maps.git@master
Patch Set: Created 7 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/parser.dart » ('j') | lib/source_maps.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Contains a builder object useful for creating source maps programatically. 5 /// Contains a builder object useful for creating source maps programatically.
6 library source_maps.builder; 6 library source_maps.builder;
7 7
8 // TODO(sigmund): add a builder for multi-section mappings. 8 // TODO(sigmund): add a builder for multi-section mappings.
9 9
10 import 'dart:json' as json; 10 import 'dart:json' as json;
(...skipping 10 matching lines...) Expand all
21 /// Indices associated with file urls that will be part of the source map. We 21 /// Indices associated with file urls that will be part of the source map. We
22 /// use a linked hash-map so that `_urls.keys[_urls[u]] == u` 22 /// use a linked hash-map so that `_urls.keys[_urls[u]] == u`
23 final Map<String, int> _urls = new LinkedHashMap<String, int>(); 23 final Map<String, int> _urls = new LinkedHashMap<String, int>();
24 24
25 /// Indices associated with identifiers that will be part of the source map. 25 /// Indices associated with identifiers that will be part of the source map.
26 /// We use a linked hash-map so that `_names.keys[_names[n]] == n` 26 /// We use a linked hash-map so that `_names.keys[_names[n]] == n`
27 final Map<String, int> _names = new LinkedHashMap<String, int>(); 27 final Map<String, int> _names = new LinkedHashMap<String, int>();
28 28
29 /// Adds an entry mapping the [targetOffset] to [source]. 29 /// Adds an entry mapping the [targetOffset] to [source].
30 void addFromOffset(Location source, 30 void addFromOffset(Location source,
31 File targetFile, int targetOffset, String identifier) { 31 SourceFile targetFile, int targetOffset, String identifier) {
32 if (targetFile == null) { 32 if (targetFile == null) {
33 throw new ArgumentError('targetFile cannot be null'); 33 throw new ArgumentError('targetFile cannot be null');
34 } 34 }
35 _entries.add(new Entry(source, 35 _entries.add(new Entry(source,
36 new FileLocation(targetFile, targetOffset), identifier)); 36 new FileLocation(targetFile, targetOffset), identifier));
37 } 37 }
38 38
39 /// Adds an entry mapping [target] to [source]. 39 /// Adds an entry mapping [target] to [source].
40 void addSpan(Span source, Span target) { 40 void addSpan(Span source, Span target) {
41 var name = source.isIdentifier ? source.text : null; 41 var name = source.isIdentifier ? source.text : null;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 /// because source map files are encoded by printing each mapping in order as 137 /// because source map files are encoded by printing each mapping in order as
138 /// they appear in the target file. 138 /// they appear in the target file.
139 int compareTo(Entry other) { 139 int compareTo(Entry other) {
140 int res = target.compareTo(other.target); 140 int res = target.compareTo(other.target);
141 if (res != 0) return res; 141 if (res != 0) return res;
142 res = source.sourceUrl.compareTo(other.source.sourceUrl); 142 res = source.sourceUrl.compareTo(other.source.sourceUrl);
143 if (res != 0) return res; 143 if (res != 0) return res;
144 return source.compareTo(other.source); 144 return source.compareTo(other.source);
145 } 145 }
146 } 146 }
OLDNEW
« no previous file with comments | « no previous file | lib/parser.dart » ('j') | lib/source_maps.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698