|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a |
3 | 3 | // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
|
| 5 | +/// This file is partially generated, using [GenerateNodeImpl]. |
| 6 | +/// After modifying any these annotations, run |
| 7 | +/// 'dart run pkg/analyzer/tool/generators/ast_generator.dart' to update. |
| 8 | +library; |
| 9 | + |
5 | 10 | import 'dart:collection'; |
6 | 11 | import 'dart:math' as math; |
7 | 12 |
|
@@ -12112,18 +12117,41 @@ final class FunctionTypedFormalParameterImpl extends NormalFormalParameterImpl |
12112 | 12117 | } |
12113 | 12118 |
|
12114 | 12119 | class GenerateNodeImpl { |
| 12120 | + /// The order is important for [AstNodeImpl._childEntities]. |
12115 | 12121 | final List<GenerateNodeProperty> childEntitiesOrder; |
12116 | 12122 |
|
12117 | 12123 | const GenerateNodeImpl({required this.childEntitiesOrder}); |
12118 | 12124 | } |
12119 | 12125 |
|
| 12126 | +/// Description for a single property in the node implementation. |
| 12127 | +/// |
| 12128 | +/// Most of these description refer to properties of the public interface, |
| 12129 | +/// e.g. `Foo` in `class FooImpl extends BarImpl implements Baz, Foo`. |
12120 | 12130 | class GenerateNodeProperty { |
12121 | 12131 | final String name; |
| 12132 | + |
| 12133 | + /// If `true`, then `super.name` should be generated in the constructor, |
| 12134 | + /// and no field or getter is generated, unless [superNullAssertOverride]. |
12122 | 12135 | final bool isSuper; |
| 12136 | + |
| 12137 | + /// Normally [Token] properties are final, but sometimes we mutate nodes. |
12123 | 12138 | final bool isTokenFinal; |
| 12139 | + |
| 12140 | + /// When the property is from the public interface, its field or getter |
| 12141 | + /// should have `@override` annotation. But sometimes we want to have |
| 12142 | + /// implementation only property, not in the public interface. |
12124 | 12143 | final bool withOverride; |
| 12144 | + |
| 12145 | + /// To generate overrides like `Token get name => super.name!;`. |
| 12146 | + /// Obviously, these are always paired with [isSuper]. |
12125 | 12147 | final bool superNullAssertOverride; |
| 12148 | + |
| 12149 | + /// Sometimes we use [Token.lexicallyFirst], and want to describe which |
| 12150 | + /// group of tokens to use. |
12126 | 12151 | final int? tokenGroupId; |
| 12152 | + |
| 12153 | + /// If the property does not exist in the public interface, we still need |
| 12154 | + /// to know its type. |
12127 | 12155 | final Type? type; |
12128 | 12156 |
|
12129 | 12157 | const GenerateNodeProperty( |
|
0 commit comments