| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_impl; | 5 library analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'generated/constant.dart'; | 10 import 'generated/constant.dart'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * The maximum number of sources for which AST structures should be kept in the
cache. | 29 * The maximum number of sources for which AST structures should be kept in the
cache. |
| 30 */ | 30 */ |
| 31 const int _MAX_CACHE_SIZE = 512; | 31 const int _MAX_CACHE_SIZE = 512; |
| 32 | 32 |
| 33 DirectoryBasedDartSdk sdk; | 33 DirectoryBasedDartSdk sdk; |
| 34 | 34 |
| 35 /// Analyzes single library [File]. | 35 /// Analyzes single library [File]. |
| 36 class AnalyzerImpl { | 36 class AnalyzerImpl { |
| 37 /** | 37 /** |
| 38 * Compute the severity of the error; however, if | 38 * Compute the severity of the error; however, if |
| 39 * [escalateCheckedModeCompileTimeErrors] is true, then escalate it to | 39 * [enableTypeChecks] is false, then de-escalate checked-mode compile time |
| 40 * [ErrorSeverity.ERROR]. | 40 * errors to a severity of [ErrorSeverity.INFO]. |
| 41 */ | 41 */ |
| 42 static ErrorSeverity computeSeverity( | 42 static ErrorSeverity computeSeverity( |
| 43 AnalysisError error, bool escalateCheckedModeCompileTimeErrors) { | 43 AnalysisError error, bool enableTypeChecks) { |
| 44 if (escalateCheckedModeCompileTimeErrors | 44 if (!enableTypeChecks |
| 45 && error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) { | 45 && error.errorCode.type == ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR) { |
| 46 return ErrorSeverity.ERROR; | 46 return ErrorSeverity.INFO; |
| 47 } | 47 } |
| 48 return error.errorCode.errorSeverity; | 48 return error.errorCode.errorSeverity; |
| 49 } | 49 } |
| 50 | 50 |
| 51 final String sourcePath; | 51 final String sourcePath; |
| 52 final CommandLineOptions options; | 52 final CommandLineOptions options; |
| 53 final int startTime; | 53 final int startTime; |
| 54 | 54 |
| 55 ContentCache contentCache = new ContentCache(); | 55 ContentCache contentCache = new ContentCache(); |
| 56 SourceFactory sourceFactory; | 56 SourceFactory sourceFactory; |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 | 429 |
| 430 @override | 430 @override |
| 431 void logInformation2(String message, Exception exception) { | 431 void logInformation2(String message, Exception exception) { |
| 432 if (log) { | 432 if (log) { |
| 433 stdout.writeln(message); | 433 stdout.writeln(message); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 } | 436 } |
| OLD | NEW |