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

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

Issue 2365553004: Convert subclasses of Enum (Closed)
Patch Set: Created 4 years, 2 months 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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 /** 943 /**
944 * Initialize an newly created error info with the given [errors] and 944 * Initialize an newly created error info with the given [errors] and
945 * [lineInfo]. 945 * [lineInfo].
946 */ 946 */
947 AnalysisErrorInfoImpl(this.errors, this.lineInfo); 947 AnalysisErrorInfoImpl(this.errors, this.lineInfo);
948 } 948 }
949 949
950 /** 950 /**
951 * The levels at which a source can be analyzed. 951 * The levels at which a source can be analyzed.
952 */ 952 */
953 class AnalysisLevel extends Enum<AnalysisLevel> { 953 class AnalysisLevel implements Comparable<AnalysisLevel> {
954 /** 954 /**
955 * Indicates a source should be fully analyzed. 955 * Indicates a source should be fully analyzed.
956 */ 956 */
957 static const AnalysisLevel ALL = const AnalysisLevel('ALL', 0); 957 static const AnalysisLevel ALL = const AnalysisLevel('ALL', 0);
958 958
959 /** 959 /**
960 * Indicates a source should be resolved and that errors, warnings and hints a re needed. 960 * Indicates a source should be resolved and that errors, warnings and hints
961 * are needed.
961 */ 962 */
962 static const AnalysisLevel ERRORS = const AnalysisLevel('ERRORS', 1); 963 static const AnalysisLevel ERRORS = const AnalysisLevel('ERRORS', 1);
963 964
964 /** 965 /**
965 * Indicates a source should be resolved, but that errors, warnings and hints are not needed. 966 * Indicates a source should be resolved, but that errors, warnings and hints
967 * are not needed.
966 */ 968 */
967 static const AnalysisLevel RESOLVED = const AnalysisLevel('RESOLVED', 2); 969 static const AnalysisLevel RESOLVED = const AnalysisLevel('RESOLVED', 2);
968 970
969 /** 971 /**
970 * Indicates a source is not of interest to the client. 972 * Indicates a source is not of interest to the client.
971 */ 973 */
972 static const AnalysisLevel NONE = const AnalysisLevel('NONE', 3); 974 static const AnalysisLevel NONE = const AnalysisLevel('NONE', 3);
973 975
974 static const List<AnalysisLevel> values = const [ALL, ERRORS, RESOLVED, NONE]; 976 static const List<AnalysisLevel> values = const [ALL, ERRORS, RESOLVED, NONE];
975 977
976 const AnalysisLevel(String name, int ordinal) : super(name, ordinal); 978 /**
979 * The name of this analysis level.
980 */
981 final String name;
982
983 /**
984 * The ordinal value of the analysis level.
985 */
986 final int ordinal;
987
988 const AnalysisLevel(this.name, this.ordinal);
989
990 @override
991 int get hashCode => ordinal;
992
993 @override
994 int compareTo(AnalysisLevel other) => ordinal - other.ordinal;
995
996 @override
997 String toString() => name;
977 } 998 }
978 999
979 /** 1000 /**
980 * An object that is listening for results being produced by an analysis 1001 * An object that is listening for results being produced by an analysis
981 * context. 1002 * context.
982 */ 1003 */
983 abstract class AnalysisListener { 1004 abstract class AnalysisListener {
984 /** 1005 /**
985 * Reports that a task, described by the given [taskDescription] is about to 1006 * Reports that a task, described by the given [taskDescription] is about to
986 * be performed by the given [context]. 1007 * be performed by the given [context].
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 1243
1223 @override 1244 @override
1224 bool dart2jsHint = false; 1245 bool dart2jsHint = false;
1225 1246
1226 @override 1247 @override
1227 bool enableAssertInitializer = false; 1248 bool enableAssertInitializer = false;
1228 1249
1229 @override 1250 @override
1230 bool enableAssertMessage = false; 1251 bool enableAssertMessage = false;
1231 1252
1232 @deprecated
1233 @override
1234 bool get enableAsync => true;
1235
1236 @deprecated
1237 void set enableAsync(bool enable) {}
1238
1239 @override 1253 @override
1240 bool enableGenericMethods = false; 1254 bool enableGenericMethods = false;
1241 1255
1242 @override 1256 @override
1243 bool enableInitializingFormalAccess = false; 1257 bool enableInitializingFormalAccess = false;
1244 1258
1245 @override 1259 @override
1246 bool enableLazyAssignmentOperators = false; 1260 bool enableLazyAssignmentOperators = false;
1247 1261
1248 @override 1262 @override
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 AnalyzeFunctionBodiesPredicate get analyzeFunctionBodiesPredicate => 1398 AnalyzeFunctionBodiesPredicate get analyzeFunctionBodiesPredicate =>
1385 _analyzeFunctionBodiesPredicate; 1399 _analyzeFunctionBodiesPredicate;
1386 1400
1387 set analyzeFunctionBodiesPredicate(AnalyzeFunctionBodiesPredicate value) { 1401 set analyzeFunctionBodiesPredicate(AnalyzeFunctionBodiesPredicate value) {
1388 if (value == null) { 1402 if (value == null) {
1389 throw new ArgumentError.notNull('analyzeFunctionBodiesPredicate'); 1403 throw new ArgumentError.notNull('analyzeFunctionBodiesPredicate');
1390 } 1404 }
1391 _analyzeFunctionBodiesPredicate = value; 1405 _analyzeFunctionBodiesPredicate = value;
1392 } 1406 }
1393 1407
1408 @deprecated
1409 @override
1410 bool get enableAsync => true;
1411
1412 @deprecated
1413 void set enableAsync(bool enable) {}
1414
1394 /** 1415 /**
1395 * A flag indicating whether interface libraries are to be supported (DEP 40). 1416 * A flag indicating whether interface libraries are to be supported (DEP 40).
1396 */ 1417 */
1397 bool get enableConditionalDirectives => true; 1418 bool get enableConditionalDirectives => true;
1398 1419
1399 @deprecated 1420 @deprecated
1400 void set enableConditionalDirectives(_) {} 1421 void set enableConditionalDirectives(_) {}
1401 1422
1402 @override 1423 @override
1403 int encodeCrossContextOptions() => 1424 int encodeCrossContextOptions() =>
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 * does not match the modification time of the source associated with the 1592 * does not match the modification time of the source associated with the
1572 * entry). Invalid entries will be marked as invalid so that the source will 1593 * entry). Invalid entries will be marked as invalid so that the source will
1573 * be re-analyzed. Return `true` if at least one entry was invalid. 1594 * be re-analyzed. Return `true` if at least one entry was invalid.
1574 */ 1595 */
1575 bool sourceModificationTimesComputed(List<Source> sources, List<int> times); 1596 bool sourceModificationTimesComputed(List<Source> sources, List<int> times);
1576 } 1597 }
1577 1598
1578 /** 1599 /**
1579 * The possible states of cached data. 1600 * The possible states of cached data.
1580 */ 1601 */
1581 class CacheState extends Enum<CacheState> { 1602 class CacheState implements Comparable<CacheState> {
1582 /** 1603 /**
1583 * The data is not in the cache and the last time an attempt was made to 1604 * The data is not in the cache and the last time an attempt was made to
1584 * compute the data an exception occurred, making it pointless to attempt to 1605 * compute the data an exception occurred, making it pointless to attempt to
1585 * compute the data again. 1606 * compute the data again.
1586 * 1607 *
1587 * Valid Transitions: 1608 * Valid Transitions:
1588 * * [INVALID] if a source was modified that might cause the data to be 1609 * * [INVALID] if a source was modified that might cause the data to be
1589 * computable 1610 * computable
1590 */ 1611 */
1591 static const CacheState ERROR = const CacheState('ERROR', 0); 1612 static const CacheState ERROR = const CacheState('ERROR', 0);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 static const CacheState VALID = const CacheState('VALID', 4); 1653 static const CacheState VALID = const CacheState('VALID', 4);
1633 1654
1634 static const List<CacheState> values = const [ 1655 static const List<CacheState> values = const [
1635 ERROR, 1656 ERROR,
1636 FLUSHED, 1657 FLUSHED,
1637 IN_PROCESS, 1658 IN_PROCESS,
1638 INVALID, 1659 INVALID,
1639 VALID 1660 VALID
1640 ]; 1661 ];
1641 1662
1642 const CacheState(String name, int ordinal) : super(name, ordinal); 1663 /**
1664 * The name of this cache state.
1665 */
1666 final String name;
1667
1668 /**
1669 * The ordinal value of the cache state.
1670 */
1671 final int ordinal;
1672
1673 const CacheState(this.name, this.ordinal);
1674
1675 @override
1676 int get hashCode => ordinal;
1677
1678 @override
1679 int compareTo(CacheState other) => ordinal - other.ordinal;
1680
1681 @override
1682 String toString() => name;
1643 } 1683 }
1644 1684
1645 /** 1685 /**
1646 * An object that represents a change to the analysis results associated with a 1686 * An object that represents a change to the analysis results associated with a
1647 * given source. 1687 * given source.
1648 */ 1688 */
1649 abstract class ChangeNotice implements AnalysisErrorInfo { 1689 abstract class ChangeNotice implements AnalysisErrorInfo {
1650 /** 1690 /**
1651 * The parsed, but maybe not resolved Dart AST that changed as a result of 1691 * The parsed, but maybe not resolved Dart AST that changed as a result of
1652 * the analysis, or `null` if the AST was not changed. 1692 * the analysis, or `null` if the AST was not changed.
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2632 * The data that was created from the source. 2672 * The data that was created from the source.
2633 */ 2673 */
2634 final E data; 2674 final E data;
2635 2675
2636 /** 2676 /**
2637 * Initialize a newly created holder to associate the given [data] with the 2677 * Initialize a newly created holder to associate the given [data] with the
2638 * given [modificationTime]. 2678 * given [modificationTime].
2639 */ 2679 */
2640 TimestampedData(this.modificationTime, this.data); 2680 TimestampedData(this.modificationTime, this.data);
2641 } 2681 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/lib/src/generated/java_core.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698