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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 2488043002: Enable generic method support by default (Closed)
Patch Set: clean up Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.src.generated.engine; 5 library analyzer.src.generated.engine;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 1109
1110 /** 1110 /**
1111 * Return `true` to enable interface libraries (DEP 40). 1111 * Return `true` to enable interface libraries (DEP 40).
1112 */ 1112 */
1113 @deprecated 1113 @deprecated
1114 bool get enableConditionalDirectives; 1114 bool get enableConditionalDirectives;
1115 1115
1116 /** 1116 /**
1117 * Return `true` to enable generic methods (DEP 22). 1117 * Return `true` to enable generic methods (DEP 22).
1118 */ 1118 */
1119 @deprecated
1119 bool get enableGenericMethods => null; 1120 bool get enableGenericMethods => null;
1120 1121
1121 /** 1122 /**
1122 * Return `true` if access to field formal parameters should be allowed in a 1123 * Return `true` if access to field formal parameters should be allowed in a
1123 * constructor's initializer list. 1124 * constructor's initializer list.
1124 */ 1125 */
1125 bool get enableInitializingFormalAccess; 1126 bool get enableInitializingFormalAccess;
1126 1127
1127 /** 1128 /**
1128 * Return `true` to enable the lazy compound assignment operators '&&=' and 1129 * Return `true` to enable the lazy compound assignment operators '&&=' and
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 return true; 1253 return true;
1253 } 1254 }
1254 } 1255 }
1255 1256
1256 /** 1257 /**
1257 * A set of analysis options used to control the behavior of an analysis 1258 * A set of analysis options used to control the behavior of an analysis
1258 * context. 1259 * context.
1259 */ 1260 */
1260 class AnalysisOptionsImpl implements AnalysisOptions { 1261 class AnalysisOptionsImpl implements AnalysisOptions {
1261 /** 1262 /**
1262 * DEPRECATED: The maximum number of sources for which data should be kept in the cache. 1263 * DEPRECATED: The maximum number of sources for which data should be kept in
1264 * the cache.
1263 * 1265 *
1264 * This constant no longer has any effect. 1266 * This constant no longer has any effect.
1265 */ 1267 */
1266 @deprecated 1268 @deprecated
1267 static const int DEFAULT_CACHE_SIZE = 64; 1269 static const int DEFAULT_CACHE_SIZE = 64;
1268 1270
1269 static const int ENABLE_ASSERT_FLAG = 0x01; 1271 static const int ENABLE_ASSERT_FLAG = 0x01;
1270 static const int ENABLE_GENERIC_METHODS_FLAG = 0x02; 1272 static const int ENABLE_LAZY_ASSIGNMENT_OPERATORS = 0x02;
1271 static const int ENABLE_LAZY_ASSIGNMENT_OPERATORS = 0x04; 1273 static const int ENABLE_STRICT_CALL_CHECKS_FLAG = 0x04;
1272 static const int ENABLE_STRICT_CALL_CHECKS_FLAG = 0x08; 1274 static const int ENABLE_STRONG_MODE_FLAG = 0x08;
1273 static const int ENABLE_STRONG_MODE_FLAG = 0x10; 1275 static const int ENABLE_STRONG_MODE_HINTS_FLAG = 0x10;
1274 static const int ENABLE_STRONG_MODE_HINTS_FLAG = 0x20; 1276 static const int ENABLE_SUPER_MIXINS_FLAG = 0x20;
1275 static const int ENABLE_SUPER_MIXINS_FLAG = 0x40;
1276 1277
1277 /** 1278 /**
1278 * The default list of non-nullable type names. 1279 * The default list of non-nullable type names.
1279 */ 1280 */
1280 static const List<String> NONNULLABLE_TYPES = const <String>[]; 1281 static const List<String> NONNULLABLE_TYPES = const <String>[];
1281 1282
1282 /** 1283 /**
1283 * A predicate indicating whether analysis is to parse and analyze function 1284 * A predicate indicating whether analysis is to parse and analyze function
1284 * bodies. 1285 * bodies.
1285 */ 1286 */
1286 AnalyzeFunctionBodiesPredicate _analyzeFunctionBodiesPredicate = 1287 AnalyzeFunctionBodiesPredicate _analyzeFunctionBodiesPredicate =
1287 _analyzeAllFunctionBodies; 1288 _analyzeAllFunctionBodies;
1288 1289
1289 @override 1290 @override
1290 @deprecated 1291 @deprecated
1291 int cacheSize = DEFAULT_CACHE_SIZE; 1292 int cacheSize = 64;
1292 1293
1293 @override 1294 @override
1294 bool dart2jsHint = false; 1295 bool dart2jsHint = false;
1295 1296
1296 @override 1297 @override
1297 bool enableAssertInitializer = false; 1298 bool enableAssertInitializer = false;
1298 1299
1299 @override 1300 @override
1300 bool enableAssertMessage = false; 1301 bool enableAssertMessage = false;
1301 1302
1302 @override 1303 @override
1303 bool enableGenericMethods = false;
1304
1305 @override
1306 bool enableInitializingFormalAccess = false; 1304 bool enableInitializingFormalAccess = false;
1307 1305
1308 @override 1306 @override
1309 bool enableLazyAssignmentOperators = false; 1307 bool enableLazyAssignmentOperators = false;
1310 1308
1311 @override 1309 @override
1312 bool enableStrictCallChecks = false; 1310 bool enableStrictCallChecks = false;
1313 1311
1314 @override 1312 @override
1315 bool enableSuperMixins = false; 1313 bool enableSuperMixins = false;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 /** 1397 /**
1400 * Initialize a newly created set of analysis options to have the same values 1398 * Initialize a newly created set of analysis options to have the same values
1401 * as those in the given set of analysis [options]. 1399 * as those in the given set of analysis [options].
1402 */ 1400 */
1403 AnalysisOptionsImpl.from(AnalysisOptions options) { 1401 AnalysisOptionsImpl.from(AnalysisOptions options) {
1404 analyzeFunctionBodiesPredicate = options.analyzeFunctionBodiesPredicate; 1402 analyzeFunctionBodiesPredicate = options.analyzeFunctionBodiesPredicate;
1405 dart2jsHint = options.dart2jsHint; 1403 dart2jsHint = options.dart2jsHint;
1406 enableAssertInitializer = options.enableAssertInitializer; 1404 enableAssertInitializer = options.enableAssertInitializer;
1407 enableAssertMessage = options.enableAssertMessage; 1405 enableAssertMessage = options.enableAssertMessage;
1408 enableStrictCallChecks = options.enableStrictCallChecks; 1406 enableStrictCallChecks = options.enableStrictCallChecks;
1409 enableGenericMethods = options.enableGenericMethods;
1410 enableInitializingFormalAccess = options.enableInitializingFormalAccess; 1407 enableInitializingFormalAccess = options.enableInitializingFormalAccess;
1411 enableLazyAssignmentOperators = options.enableLazyAssignmentOperators; 1408 enableLazyAssignmentOperators = options.enableLazyAssignmentOperators;
1412 enableSuperMixins = options.enableSuperMixins; 1409 enableSuperMixins = options.enableSuperMixins;
1413 enableTiming = options.enableTiming; 1410 enableTiming = options.enableTiming;
1414 generateImplicitErrors = options.generateImplicitErrors; 1411 generateImplicitErrors = options.generateImplicitErrors;
1415 generateSdkErrors = options.generateSdkErrors; 1412 generateSdkErrors = options.generateSdkErrors;
1416 hint = options.hint; 1413 hint = options.hint;
1417 incremental = options.incremental; 1414 incremental = options.incremental;
1418 incrementalApi = options.incrementalApi; 1415 incrementalApi = options.incrementalApi;
1419 incrementalValidation = options.incrementalValidation; 1416 incrementalValidation = options.incrementalValidation;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 1468
1472 /** 1469 /**
1473 * A flag indicating whether interface libraries are to be supported (DEP 40). 1470 * A flag indicating whether interface libraries are to be supported (DEP 40).
1474 */ 1471 */
1475 bool get enableConditionalDirectives => true; 1472 bool get enableConditionalDirectives => true;
1476 1473
1477 @deprecated 1474 @deprecated
1478 void set enableConditionalDirectives(_) {} 1475 void set enableConditionalDirectives(_) {}
1479 1476
1480 @override 1477 @override
1478 @deprecated
1479 bool get enableGenericMethods => true;
1480
1481 @deprecated
1482 void set enableGenericMethods(bool enable) {}
1483
1484 @override
1481 List<int> encodeCrossContextOptions() { 1485 List<int> encodeCrossContextOptions() {
1482 int flags = (enableAssertMessage ? ENABLE_ASSERT_FLAG : 0) | 1486 int flags = (enableAssertMessage ? ENABLE_ASSERT_FLAG : 0) |
1483 (enableGenericMethods ? ENABLE_GENERIC_METHODS_FLAG : 0) |
1484 (enableLazyAssignmentOperators ? ENABLE_LAZY_ASSIGNMENT_OPERATORS : 0) | 1487 (enableLazyAssignmentOperators ? ENABLE_LAZY_ASSIGNMENT_OPERATORS : 0) |
1485 (enableStrictCallChecks ? ENABLE_STRICT_CALL_CHECKS_FLAG : 0) | 1488 (enableStrictCallChecks ? ENABLE_STRICT_CALL_CHECKS_FLAG : 0) |
1486 (enableSuperMixins ? ENABLE_SUPER_MIXINS_FLAG : 0) | 1489 (enableSuperMixins ? ENABLE_SUPER_MIXINS_FLAG : 0) |
1487 (strongMode ? ENABLE_STRONG_MODE_FLAG : 0) | 1490 (strongMode ? ENABLE_STRONG_MODE_FLAG : 0) |
1488 (strongModeHints ? ENABLE_STRONG_MODE_HINTS_FLAG : 0); 1491 (strongModeHints ? ENABLE_STRONG_MODE_HINTS_FLAG : 0);
1489 return <int>[flags, patchPlatform]; 1492 return <int>[flags, patchPlatform];
1490 } 1493 }
1491 1494
1492 @override 1495 @override
1493 void setCrossContextOptionsFrom(AnalysisOptions options) { 1496 void setCrossContextOptionsFrom(AnalysisOptions options) {
1494 enableAssertMessage = options.enableAssertMessage; 1497 enableAssertMessage = options.enableAssertMessage;
1495 enableGenericMethods = options.enableGenericMethods;
1496 enableLazyAssignmentOperators = options.enableLazyAssignmentOperators; 1498 enableLazyAssignmentOperators = options.enableLazyAssignmentOperators;
1497 enableStrictCallChecks = options.enableStrictCallChecks; 1499 enableStrictCallChecks = options.enableStrictCallChecks;
1498 enableSuperMixins = options.enableSuperMixins; 1500 enableSuperMixins = options.enableSuperMixins;
1499 strongMode = options.strongMode; 1501 strongMode = options.strongMode;
1500 if (options is AnalysisOptionsImpl) { 1502 if (options is AnalysisOptionsImpl) {
1501 strongModeHints = options.strongModeHints; 1503 strongModeHints = options.strongModeHints;
1502 } 1504 }
1503 patchPlatform = options.patchPlatform; 1505 patchPlatform = options.patchPlatform;
1504 } 1506 }
1505 1507
1506 /** 1508 /**
1507 * Produce a human readable list of option names corresponding to the options 1509 * Produce a human readable list of option names corresponding to the options
1508 * encoded in the given [encoding], presumably from invoking the method 1510 * encoded in the given [encoding], presumably from invoking the method
1509 * [encodeCrossContextOptions]. 1511 * [encodeCrossContextOptions].
1510 */ 1512 */
1511 static String decodeCrossContextOptions(List<int> encoding) { 1513 static String decodeCrossContextOptions(List<int> encoding) {
1512 List<String> parts = []; 1514 List<String> parts = [];
1513 int flags = encoding[0]; 1515 int flags = encoding[0];
1514 if (flags & ENABLE_ASSERT_FLAG > 0) { 1516 if (flags & ENABLE_ASSERT_FLAG > 0) {
1515 parts.add('assert'); 1517 parts.add('assert');
1516 } 1518 }
1517 if (flags & ENABLE_GENERIC_METHODS_FLAG > 0) {
1518 parts.add('genericMethods');
1519 }
1520 if (flags & ENABLE_LAZY_ASSIGNMENT_OPERATORS > 0) { 1519 if (flags & ENABLE_LAZY_ASSIGNMENT_OPERATORS > 0) {
1521 parts.add('lazyAssignmentOperators'); 1520 parts.add('lazyAssignmentOperators');
1522 } 1521 }
1523 if (flags & ENABLE_STRICT_CALL_CHECKS_FLAG > 0) { 1522 if (flags & ENABLE_STRICT_CALL_CHECKS_FLAG > 0) {
1524 parts.add('strictCallChecks'); 1523 parts.add('strictCallChecks');
1525 } 1524 }
1526 if (flags & ENABLE_SUPER_MIXINS_FLAG > 0) { 1525 if (flags & ENABLE_SUPER_MIXINS_FLAG > 0) {
1527 parts.add('superMixins'); 1526 parts.add('superMixins');
1528 } 1527 }
1529 if (flags & ENABLE_STRONG_MODE_FLAG > 0) { 1528 if (flags & ENABLE_STRONG_MODE_FLAG > 0) {
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 * The data that was created from the source. 2733 * The data that was created from the source.
2735 */ 2734 */
2736 final E data; 2735 final E data;
2737 2736
2738 /** 2737 /**
2739 * Initialize a newly created holder to associate the given [data] with the 2738 * Initialize a newly created holder to associate the given [data] with the
2740 * given [modificationTime]. 2739 * given [modificationTime].
2741 */ 2740 */
2742 TimestampedData(this.modificationTime, this.data); 2741 TimestampedData(this.modificationTime, this.data);
2743 } 2742 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698