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

Unified Diff: pkg/analyzer/tool/summary/idl_model.dart

Issue 1753883002: Add the ability to deprecate Flatbuffer fields. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/tool/summary/generate.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/tool/summary/idl_model.dart
diff --git a/pkg/analyzer/tool/summary/idl_model.dart b/pkg/analyzer/tool/summary/idl_model.dart
index a583d647a26fcdb0372c92cfcbba9152a60b2d6d..9ec248f994e41695ad4749531a100f0946ad8101 100644
--- a/pkg/analyzer/tool/summary/idl_model.dart
+++ b/pkg/analyzer/tool/summary/idl_model.dart
@@ -14,9 +14,9 @@ library analyzer.tool.summary.idl_model;
*/
class ClassDeclaration extends Declaration {
/**
- * Fields defined in the class.
+ * All fields defined in the class, including deprecated ones.
*/
- final List<FieldDeclaration> fields = <FieldDeclaration>[];
+ final List<FieldDeclaration> allFields = <FieldDeclaration>[];
/**
* Indicates whether the class has the `topLevel` annotation.
@@ -32,6 +32,12 @@ class ClassDeclaration extends Declaration {
ClassDeclaration(
String documentation, String name, this.isTopLevel, this.fileIdentifier)
: super(documentation, name);
+
+ /**
+ * Get the non-deprecated fields defined in the class.
+ */
+ Iterable<FieldDeclaration> get fields =>
+ allFields.where((FieldDeclaration field) => !field.isDeprecated);
}
/**
@@ -86,7 +92,13 @@ class FieldDeclaration extends Declaration {
*/
final int id;
- FieldDeclaration(String documentation, String name, this.type, this.id)
+ /**
+ * Indicates whether the field is deprecated.
+ */
+ final bool isDeprecated;
+
+ FieldDeclaration(
+ String documentation, String name, this.type, this.id, this.isDeprecated)
: super(documentation, name);
}
« no previous file with comments | « pkg/analyzer/tool/summary/generate.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698