mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 13:57:58 +00:00
Support for experimental fields in analyzer_plugin common_types_spec.html
Change-Id: Id91cf321f4f99e29fd3f2be672335ae5c349f195 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216683 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
3b1d941ae8
commit
238a72a321
|
@ -529,7 +529,7 @@ class ApiReader {
|
|||
throw Exception('$context: name not specified');
|
||||
}
|
||||
|
||||
context = '$context.$name}';
|
||||
context = '$context.$name';
|
||||
checkAttributes(html, ['name'], context,
|
||||
optionalAttributes: [
|
||||
'optional',
|
||||
|
|
|
@ -754,6 +754,7 @@ class TypeVisitor extends HierarchicalApiVisitor
|
|||
writeln('{');
|
||||
indent(() {
|
||||
for (var field in typeObject.fields) {
|
||||
if (field.experimental) continue;
|
||||
write('"');
|
||||
if (fieldsToBold.contains(field.name)) {
|
||||
b(() {
|
||||
|
|
|
@ -478,11 +478,22 @@ class ApiReader {
|
|||
/// Child elements can occur in any order.
|
||||
TypeObjectField typeObjectFieldFromHtml(dom.Element html, String context) {
|
||||
checkName(html, 'field', context);
|
||||
|
||||
var name = html.attributes['name'];
|
||||
context = '$context.${name ?? 'field'}';
|
||||
if (name == null) {
|
||||
throw Exception('$context: name not specified');
|
||||
}
|
||||
|
||||
context = '$context.$name';
|
||||
checkAttributes(html, ['name'], context,
|
||||
optionalAttributes: ['optional', 'value', 'deprecated']);
|
||||
optionalAttributes: [
|
||||
'optional',
|
||||
'value',
|
||||
'deprecated',
|
||||
'experimental'
|
||||
]);
|
||||
var deprecated = html.attributes['deprecated'] == 'true';
|
||||
var experimental = html.attributes['experimental'] == 'true';
|
||||
var optional = false;
|
||||
var optionalString = html.attributes['optional'];
|
||||
if (optionalString != null) {
|
||||
|
@ -500,8 +511,11 @@ class ApiReader {
|
|||
}
|
||||
var value = html.attributes['value'];
|
||||
var type = processContentsAsType(html, context);
|
||||
return TypeObjectField(name!, type, html,
|
||||
optional: optional, value: value, deprecated: deprecated);
|
||||
return TypeObjectField(name, type, html,
|
||||
optional: optional,
|
||||
value: value,
|
||||
deprecated: deprecated,
|
||||
experimental: experimental);
|
||||
}
|
||||
|
||||
/// Create a [TypeObject] from an HTML description.
|
||||
|
|
|
@ -644,6 +644,9 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
|
|||
|
||||
@override
|
||||
void visitTypeObjectField(TypeObjectField typeObjectField) {
|
||||
if (typeObjectField.experimental) {
|
||||
return;
|
||||
}
|
||||
dt('field', () {
|
||||
b(() {
|
||||
if (typeObjectField.deprecated) {
|
||||
|
@ -748,6 +751,7 @@ class TypeVisitor extends HierarchicalApiVisitor
|
|||
writeln('{');
|
||||
indent(() {
|
||||
for (var field in typeObject.fields) {
|
||||
if (field.experimental) continue;
|
||||
write('"');
|
||||
final fieldsToBold = this.fieldsToBold;
|
||||
if (fieldsToBold != null && fieldsToBold.contains(field.name)) {
|
||||
|
|
Loading…
Reference in a new issue