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

Side by Side Diff: pkg/compiler/lib/src/io/source_information.dart

Issue 1902363002: Derive source information from ResolvedAst. (Closed) Base URL: https://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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.source_information; 5 library dart2js.source_information;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../elements/elements.dart' show AstElement, LocalElement; 8 import '../elements/elements.dart' show AstElement, LocalElement, ResolvedAst;
9 import '../js/js.dart' show JavaScriptNodeSourceInformation; 9 import '../js/js.dart' show JavaScriptNodeSourceInformation;
10 import '../tree/tree.dart' show Node; 10 import '../tree/tree.dart' show Node;
11 import 'source_file.dart'; 11 import 'source_file.dart';
12 12
13 /// Interface for passing source information, for instance for use in source 13 /// Interface for passing source information, for instance for use in source
14 /// maps, through the backend. 14 /// maps, through the backend.
15 abstract class SourceInformation extends JavaScriptNodeSourceInformation { 15 abstract class SourceInformation extends JavaScriptNodeSourceInformation {
16 const SourceInformation(); 16 const SourceInformation();
17 17
18 SourceSpan get sourceSpan; 18 SourceSpan get sourceSpan;
(...skipping 30 matching lines...) Expand all
49 void onComplete() {} 49 void onComplete() {}
50 } 50 }
51 51
52 /// Interface for generating [SourceInformation]. 52 /// Interface for generating [SourceInformation].
53 class SourceInformationBuilder { 53 class SourceInformationBuilder {
54 const SourceInformationBuilder(); 54 const SourceInformationBuilder();
55 55
56 /// Create a [SourceInformationBuilder] for [element]. 56 /// Create a [SourceInformationBuilder] for [element].
57 SourceInformationBuilder forContext(AstElement element) => this; 57 SourceInformationBuilder forContext(AstElement element) => this;
58 58
59 /// Generate [SourceInformation] the declaration of [element]. 59 /// Generate [SourceInformation] the declaration of the element in
60 SourceInformation buildDeclaration(AstElement element) => null; 60 /// [resolvedAst].
61 SourceInformation buildDeclaration(ResolvedAst resolvedAst) => null;
61 62
62 /// Generate [SourceInformation] for the generic [node]. 63 /// Generate [SourceInformation] for the generic [node].
63 @deprecated 64 @deprecated
64 SourceInformation buildGeneric(Node node) => null; 65 SourceInformation buildGeneric(Node node) => null;
65 66
66 /// Generate [SourceInformation] for an instantiation of a class using [node] 67 /// Generate [SourceInformation] for an instantiation of a class using [node]
67 /// for the source position. 68 /// for the source position.
68 SourceInformation buildCreate(Node node) => null; 69 SourceInformation buildCreate(Node node) => null;
69 70
70 /// Generate [SourceInformation] for the return [node]. 71 /// Generate [SourceInformation] for the return [node].
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return '${computeElementNameForSourceMaps(local.executableContext)}.$name'; 237 return '${computeElementNameForSourceMaps(local.executableContext)}.$name';
237 } else if (element.enclosingClass != null) { 238 } else if (element.enclosingClass != null) {
238 if (element.enclosingClass.isClosure) { 239 if (element.enclosingClass.isClosure) {
239 return computeElementNameForSourceMaps(element.enclosingClass); 240 return computeElementNameForSourceMaps(element.enclosingClass);
240 } 241 }
241 return '${element.enclosingClass.name}.${element.name}'; 242 return '${element.enclosingClass.name}.${element.name}';
242 } else { 243 } else {
243 return element.name; 244 return element.name;
244 } 245 }
245 } 246 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/io/position_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