| 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 library kernel.analyzer.loader; | 4 library kernel.analyzer.loader; |
| 5 | 5 |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 | 9 |
| 10 import 'package:analyzer/analyzer.dart'; | 10 import 'package:analyzer/analyzer.dart'; |
| 11 import 'package:analyzer/dart/element/element.dart'; |
| 12 import 'package:analyzer/dart/element/type.dart'; |
| 11 import 'package:analyzer/file_system/file_system.dart'; | 13 import 'package:analyzer/file_system/file_system.dart'; |
| 12 import 'package:analyzer/file_system/physical_file_system.dart'; | 14 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 13 import 'package:analyzer/source/package_map_resolver.dart'; | 15 import 'package:analyzer/source/package_map_resolver.dart'; |
| 16 import 'package:analyzer/src/dart/element/member.dart'; |
| 14 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 17 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
| 15 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 18 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
| 16 import 'package:analyzer/src/generated/engine.dart'; | 19 import 'package:analyzer/src/generated/engine.dart'; |
| 17 import 'package:analyzer/src/generated/parser.dart'; | 20 import 'package:analyzer/src/generated/parser.dart'; |
| 18 import 'package:analyzer/src/generated/sdk.dart'; | 21 import 'package:analyzer/src/generated/sdk.dart'; |
| 19 import 'package:analyzer/src/generated/source_io.dart'; | 22 import 'package:analyzer/src/generated/source_io.dart'; |
| 20 import 'package:analyzer/src/summary/summary_sdk.dart'; | 23 import 'package:analyzer/src/summary/summary_sdk.dart'; |
| 21 import 'package:kernel/application_root.dart'; | 24 import 'package:kernel/application_root.dart'; |
| 22 import 'package:package_config/discovery.dart'; | 25 import 'package:package_config/discovery.dart'; |
| 23 import 'package:package_config/packages.dart'; | 26 import 'package:package_config/packages.dart'; |
| 24 | 27 |
| 25 import '../ast.dart' as ast; | 28 import 'package:kernel/ast.dart' as ast; |
| 26 import '../target/targets.dart' show Target; | 29 import 'package:kernel/target/targets.dart' show Target; |
| 27 import '../type_algebra.dart'; | 30 import 'package:kernel/type_algebra.dart'; |
| 28 import 'analyzer.dart'; | 31 import 'package:analyzer/src/kernel/ast_from_analyzer.dart'; |
| 29 import 'ast_from_analyzer.dart'; | |
| 30 | 32 |
| 31 /// Options passed to the Dart frontend. | 33 /// Options passed to the Dart frontend. |
| 32 class DartOptions { | 34 class DartOptions { |
| 33 /// True if user code should be loaded in strong mode. | 35 /// True if user code should be loaded in strong mode. |
| 34 bool strongMode; | 36 bool strongMode; |
| 35 | 37 |
| 36 /// True if the Dart SDK should be loaded in strong mode. | 38 /// True if the Dart SDK should be loaded in strong mode. |
| 37 bool strongModeSdk; | 39 bool strongModeSdk; |
| 38 | 40 |
| 39 /// Path to the sdk sources, ignored if sdkSummary is provided. | 41 /// Path to the sdk sources, ignored if sdkSummary is provided. |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 AnalysisContext context = AnalysisEngine.instance.createAnalysisContext() | 997 AnalysisContext context = AnalysisEngine.instance.createAnalysisContext() |
| 996 ..sourceFactory = new SourceFactory(resolvers) | 998 ..sourceFactory = new SourceFactory(resolvers) |
| 997 ..analysisOptions = createAnalysisOptions(options.strongMode); | 999 ..analysisOptions = createAnalysisOptions(options.strongMode); |
| 998 | 1000 |
| 999 options.declaredVariables.forEach((String name, String value) { | 1001 options.declaredVariables.forEach((String name, String value) { |
| 1000 context.declaredVariables.define(name, value); | 1002 context.declaredVariables.define(name, value); |
| 1001 }); | 1003 }); |
| 1002 | 1004 |
| 1003 return context; | 1005 return context; |
| 1004 } | 1006 } |
| OLD | NEW |