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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/source_map_builder.dart

Issue 208423012: Add helpers library to dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library source_map_builder; 5 library source_map_builder;
6 6
7
8 import 'util/util.dart'; 7 import 'util/util.dart';
9 import 'scanner/scannerlib.dart' show Token; 8 import 'scanner/scannerlib.dart' show Token;
10 import 'source_file.dart'; 9 import 'source_file.dart';
11 import 'util/uri_extras.dart' show relativize; 10 import 'util/uri_extras.dart' show relativize;
12 11
13 class SourceMapBuilder { 12 class SourceMapBuilder {
14 static const int VLQ_BASE_SHIFT = 5; 13 static const int VLQ_BASE_SHIFT = 5;
15 static const int VLQ_BASE_MASK = (1 << 5) - 1; 14 static const int VLQ_BASE_MASK = (1 << 5) - 1;
16 static const int VLQ_CONTINUATION_BIT = 1 << 5; 15 static const int VLQ_CONTINUATION_BIT = 1 << 5;
17 static const int VLQ_CONTINUATION_MASK = 1 << 5; 16 static const int VLQ_CONTINUATION_MASK = 1 << 5;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 TokenSourceFileLocation(SourceFile sourceFile, this.token) 207 TokenSourceFileLocation(SourceFile sourceFile, this.token)
209 : super(sourceFile); 208 : super(sourceFile);
210 209
211 int get offset => token.charOffset; 210 int get offset => token.charOffset;
212 211
213 String getSourceName() { 212 String getSourceName() {
214 if (token.isIdentifier()) return token.value; 213 if (token.isIdentifier()) return token.value;
215 return null; 214 return null;
216 } 215 }
217 } 216 }
218
219 class OffsetSourceFileLocation extends SourceFileLocation {
220 final int offset;
221 final String sourceName;
222 OffsetSourceFileLocation(SourceFile sourceFile, this.offset,
223 [this.sourceName]) : super(sourceFile);
224
225 String getSourceName() => sourceName;
226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698