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

Side by Side Diff: pkg/compiler/lib/src/use_unused_api.dart

Issue 2788373002: Add Source.getTextLine and use it to display source snippets in error messages. (Closed)
Patch Set: dartfmt Created 3 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 unified diff | Download patch
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 /// This file use methods that aren't used by dart2js.dart, but that we wish to 5 /// This file use methods that aren't used by dart2js.dart, but that we wish to
6 /// keep anyway. This might be general API that isn't currently in use, 6 /// keep anyway. This might be general API that isn't currently in use,
7 /// debugging aids, or API only used for testing (see TODO below). 7 /// debugging aids, or API only used for testing (see TODO below).
8 8
9 library dart2js.use_unused_api; 9 library dart2js.use_unused_api;
10 10
11 import '../compiler.dart' as api; 11 import '../compiler.dart' as api;
12 import 'colors.dart' as colors; 12 import 'colors.dart' as colors;
13 import 'compiler.dart' as compiler; 13 import 'compiler.dart' as compiler;
14 import 'constants/constant_system.dart' as constants; 14 import 'constants/constant_system.dart' as constants;
15 import 'constants/constructors.dart' as constants; 15 import 'constants/constructors.dart' as constants;
16 import 'constants/evaluation.dart' as constants; 16 import 'constants/evaluation.dart' as constants;
17 import 'constants/expressions.dart' as constants; 17 import 'constants/expressions.dart' as constants;
18 import 'constants/values.dart' as constants; 18 import 'constants/values.dart' as constants;
19 import 'dart2js.dart' as dart2js; 19 import 'dart2js.dart' as dart2js;
20 import 'elements/resolution_types.dart' as dart_types; 20 import 'elements/resolution_types.dart' as dart_types;
21 import 'deferred_load.dart' as deferred_load; 21 import 'deferred_load.dart' as deferred_load;
22 import 'diagnostics/source_span.dart' as diagnostics; 22 import 'diagnostics/source_span.dart' as diagnostics;
23 import 'elements/elements.dart' as elements; 23 import 'elements/elements.dart' as elements;
24 import 'elements/modelx.dart' as modelx; 24 import 'elements/modelx.dart' as modelx;
25 import 'elements/visitor.dart' as elements_visitor; 25 import 'elements/visitor.dart' as elements_visitor;
26 import 'filenames.dart' as filenames; 26 import 'filenames.dart' as filenames;
27 import 'inferrer/type_graph_inferrer.dart' as type_graph_inferrer; 27 import 'inferrer/type_graph_inferrer.dart' as type_graph_inferrer;
28 import 'io/line_column_provider.dart' as io; 28 import 'io/location_provider.dart' as io;
29 import 'io/source_map_builder.dart' as io; 29 import 'io/source_map_builder.dart' as io;
30 import 'js/js.dart' as js; 30 import 'js/js.dart' as js;
31 import 'js_backend/js_backend.dart' as js_backend; 31 import 'js_backend/js_backend.dart' as js_backend;
32 import 'js_emitter/full_emitter/emitter.dart' as full; 32 import 'js_emitter/full_emitter/emitter.dart' as full;
33 import 'js_emitter/js_emitter.dart' as js_emitter; 33 import 'js_emitter/js_emitter.dart' as js_emitter;
34 import 'js_emitter/program_builder/program_builder.dart' as program_builder; 34 import 'js_emitter/program_builder/program_builder.dart' as program_builder;
35 import 'parser/partial_elements.dart' 35 import 'parser/partial_elements.dart'
36 show PartialClassElement, PartialFunctionElement; 36 show PartialClassElement, PartialFunctionElement;
37 import 'resolution/operators.dart' as operators; 37 import 'resolution/operators.dart' as operators;
38 import 'resolution/semantic_visitor.dart' as semantic_visitor; 38 import 'resolution/semantic_visitor.dart' as semantic_visitor;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 useFilenames() { 226 useFilenames() {
227 filenames.appendSlash(null); 227 filenames.appendSlash(null);
228 } 228 }
229 229
230 useSsa(ssa.HInstruction instruction) { 230 useSsa(ssa.HInstruction instruction) {
231 instruction.isConstantNumber(); 231 instruction.isConstantNumber();
232 new ssa.HAndOrBlockInformation(null, null, null); 232 new ssa.HAndOrBlockInformation(null, null, null);
233 new ssa.HStatementSequenceInformation(null); 233 new ssa.HStatementSequenceInformation(null);
234 } 234 }
235 235
236 useIo([io.LineColumnMap map, io.LineColumnProvider provider]) { 236 useIo([io.LineColumnMap map, io.LocationProvider provider]) {
237 map 237 map
238 ..addFirst(null, null, null) 238 ..addFirst(null, null, null)
239 ..forEachLine(null) 239 ..forEachLine(null)
240 ..getFirstElementsInLine(null) 240 ..getFirstElementsInLine(null)
241 ..forEachColumn(null, null); 241 ..forEachColumn(null, null);
242 provider.getOffset(null, null);
243 } 242 }
244 243
245 usedByTests() { 244 usedByTests() {
246 // TODO(ahe): We should try to avoid including API used only for tests. In 245 // TODO(ahe): We should try to avoid including API used only for tests. In
247 // most cases, such API can be moved to a test library. 246 // most cases, such API can be moved to a test library.
248 ClosedWorldImpl closedWorld = null; 247 ClosedWorldImpl closedWorld = null;
249 type_graph_inferrer.TypeGraphInferrer typeGraphInferrer = null; 248 type_graph_inferrer.TypeGraphInferrer typeGraphInferrer = null;
250 source_file_provider.SourceFileProvider sourceFileProvider = null; 249 source_file_provider.SourceFileProvider sourceFileProvider = null;
251 sourceFileProvider.getSourceFile(null); 250 sourceFileProvider.getSourceFile(null);
252 closedWorld.hasAnyUserDefinedGetter(null, null); 251 closedWorld.hasAnyUserDefinedGetter(null, null);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 operators.UnaryOperator.fromKind(null); 293 operators.UnaryOperator.fromKind(null);
295 operators.BinaryOperator.fromKind(null); 294 operators.BinaryOperator.fromKind(null);
296 new semantic_visitor.BulkSendVisitor()..apply(null, null); 295 new semantic_visitor.BulkSendVisitor()..apply(null, null);
297 new semantic_visitor.TraversalVisitor(null).apply(null, null); 296 new semantic_visitor.TraversalVisitor(null).apply(null, null);
298 new semantic_visitor.BulkDeclarationVisitor().apply(null, null); 297 new semantic_visitor.BulkDeclarationVisitor().apply(null, null);
299 } 298 }
300 299
301 useDeferred([deferred_load.DeferredLoadTask task]) { 300 useDeferred([deferred_load.DeferredLoadTask task]) {
302 task.dump(); 301 task.dump();
303 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698