| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.source_loader; | 5 library fasta.source_loader; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:typed_data' show Uint8List; | 9 import 'dart:typed_data' show Uint8List; |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 class SourceLoader<L> extends Loader<L> { | 74 class SourceLoader<L> extends Loader<L> { |
| 75 /// The [FileSystem] which should be used to access files. | 75 /// The [FileSystem] which should be used to access files. |
| 76 final FileSystem fileSystem; | 76 final FileSystem fileSystem; |
| 77 | 77 |
| 78 /// Whether comments should be scanned and parsed. | 78 /// Whether comments should be scanned and parsed. |
| 79 final bool includeComments; | 79 final bool includeComments; |
| 80 | 80 |
| 81 final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{}; | 81 final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{}; |
| 82 | 82 |
| 83 final bool excludeSource = CompilerContext.current.options.excludeSource; | 83 final bool excludeSource = !CompilerContext.current.options.embedSourceText; |
| 84 | 84 |
| 85 // Used when building directly to kernel. | 85 // Used when building directly to kernel. |
| 86 ClassHierarchy hierarchy; | 86 ClassHierarchy hierarchy; |
| 87 CoreTypes coreTypes; | 87 CoreTypes coreTypes; |
| 88 | 88 |
| 89 TypeInferenceEngine typeInferenceEngine; | 89 TypeInferenceEngine typeInferenceEngine; |
| 90 | 90 |
| 91 Instrumentation instrumentation; | 91 Instrumentation instrumentation; |
| 92 | 92 |
| 93 SourceLoader(this.fileSystem, this.includeComments, KernelTarget target) | 93 SourceLoader(this.fileSystem, this.includeComments, KernelTarget target) |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 Expression throwCompileConstantError(Expression error) { | 533 Expression throwCompileConstantError(Expression error) { |
| 534 return target.backendTarget.throwCompileConstantError(coreTypes, error); | 534 return target.backendTarget.throwCompileConstantError(coreTypes, error); |
| 535 } | 535 } |
| 536 | 536 |
| 537 Expression buildCompileTimeError(Message message, int offset, Uri uri) { | 537 Expression buildCompileTimeError(Message message, int offset, Uri uri) { |
| 538 String text = target.context | 538 String text = target.context |
| 539 .format(message.withLocation(uri, offset), Severity.error); | 539 .format(message.withLocation(uri, offset), Severity.error); |
| 540 return target.backendTarget.buildCompileTimeError(coreTypes, text, offset); | 540 return target.backendTarget.buildCompileTimeError(coreTypes, text, offset); |
| 541 } | 541 } |
| 542 } | 542 } |
| OLD | NEW |