OLD | NEW |
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 analyzer_cli.src.driver; | 5 library analyzer_cli.src.driver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 291 } |
292 if (options.lints != _previousOptions.lints) { | 292 if (options.lints != _previousOptions.lints) { |
293 return false; | 293 return false; |
294 } | 294 } |
295 if (options.strongMode != _previousOptions.strongMode) { | 295 if (options.strongMode != _previousOptions.strongMode) { |
296 return false; | 296 return false; |
297 } | 297 } |
298 if (options.enableSuperMixins != _previousOptions.enableSuperMixins) { | 298 if (options.enableSuperMixins != _previousOptions.enableSuperMixins) { |
299 return false; | 299 return false; |
300 } | 300 } |
301 if (options.enableConditionalDirectives != | |
302 _previousOptions.enableConditionalDirectives) { | |
303 return false; | |
304 } | |
305 return true; | 301 return true; |
306 } | 302 } |
307 | 303 |
308 /// Decide on the appropriate policy for which files need to be fully parsed | 304 /// Decide on the appropriate policy for which files need to be fully parsed |
309 /// and which files need to be diet parsed, based on [options], and return an | 305 /// and which files need to be diet parsed, based on [options], and return an |
310 /// [AnalyzeFunctionBodiesPredicate] that implements this policy. | 306 /// [AnalyzeFunctionBodiesPredicate] that implements this policy. |
311 AnalyzeFunctionBodiesPredicate _chooseDietParsingPolicy( | 307 AnalyzeFunctionBodiesPredicate _chooseDietParsingPolicy( |
312 CommandLineOptions options) { | 308 CommandLineOptions options) { |
313 if (_isBatch) { | 309 if (_isBatch) { |
314 // As analyzer is currently implemented, once a file has been diet | 310 // As analyzer is currently implemented, once a file has been diet |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 } | 592 } |
597 _isBatch = options.shouldBatch; | 593 _isBatch = options.shouldBatch; |
598 } | 594 } |
599 | 595 |
600 static AnalysisOptionsImpl createAnalysisOptionsForCommandLineOptions( | 596 static AnalysisOptionsImpl createAnalysisOptionsForCommandLineOptions( |
601 CommandLineOptions options) { | 597 CommandLineOptions options) { |
602 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); | 598 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); |
603 contextOptions.hint = !options.disableHints; | 599 contextOptions.hint = !options.disableHints; |
604 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; | 600 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; |
605 contextOptions.enableSuperMixins = options.enableSuperMixins; | 601 contextOptions.enableSuperMixins = options.enableSuperMixins; |
606 contextOptions.enableConditionalDirectives = | |
607 options.enableConditionalDirectives; | |
608 contextOptions.generateImplicitErrors = options.showPackageWarnings; | 602 contextOptions.generateImplicitErrors = options.showPackageWarnings; |
609 contextOptions.generateSdkErrors = options.showSdkWarnings; | 603 contextOptions.generateSdkErrors = options.showSdkWarnings; |
610 contextOptions.lint = options.lints; | 604 contextOptions.lint = options.lints; |
611 contextOptions.strongMode = options.strongMode; | 605 contextOptions.strongMode = options.strongMode; |
612 return contextOptions; | 606 return contextOptions; |
613 } | 607 } |
614 | 608 |
615 static void setAnalysisContextOptions( | 609 static void setAnalysisContextOptions( |
616 AnalysisContext context, | 610 AnalysisContext context, |
617 CommandLineOptions options, | 611 CommandLineOptions options, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 for (var package in packages) { | 777 for (var package in packages) { |
784 var packageName = path.basename(package.path); | 778 var packageName = path.basename(package.path); |
785 var realPath = package.resolveSymbolicLinksSync(); | 779 var realPath = package.resolveSymbolicLinksSync(); |
786 result[packageName] = [ | 780 result[packageName] = [ |
787 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 781 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
788 ]; | 782 ]; |
789 } | 783 } |
790 return result; | 784 return result; |
791 } | 785 } |
792 } | 786 } |
OLD | NEW |