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

Unified Diff: pkg/front_end/lib/src/fasta/source/source_loader.dart

Issue 2729913005: [Fasta] include source code in dill (Closed)
Patch Set: Addressed comments Created 3 years, 10 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
Index: pkg/front_end/lib/src/fasta/source/source_loader.dart
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 5e508462945b3ac4b52d8aadfc046d5f5989957a..8e95cd2ef182d69af4f5e27af24f3f6f68ee21fb 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -40,8 +40,11 @@ import 'diet_parser.dart' show DietParser;
import 'source_library_builder.dart' show SourceLibraryBuilder;
+import '../compiler_context.dart' show CompilerContext;
+
class SourceLoader<L> extends Loader<L> {
final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{};
+ bool get includeSource => CompilerContext.current.options.includeSource;
ahe 2017/03/03 13:14:50 This should be set when constructing this object:
jensj 2017/03/06 07:38:36 Done.
// Used when building directly to kernel.
ClassHierarchy hierarchy;
@@ -64,7 +67,8 @@ class SourceLoader<L> extends Loader<L> {
ScannerResult result = scan(bytes);
Token token = result.tokens;
if (!suppressLexicalErrors) {
- target.addLineStarts(library.fileUri, result.lineStarts);
+ var source = includeSource ? bytes : const <int>[];
ahe 2017/03/03 13:14:50 var -> List<int>
jensj 2017/03/06 07:38:36 Done.
+ target.addSourceInformation(library.fileUri, result.lineStarts, source);
}
while (token is ErrorToken) {
if (!suppressLexicalErrors) {

Powered by Google App Engine
This is Rietveld 408576698