CompilationUnitImpl constructor

CompilationUnitImpl({
  1. required Token beginToken,
  2. required ScriptTagImpl? scriptTag,
  3. required List<DirectiveImpl>? directives,
  4. required List<CompilationUnitMemberImpl>? declarations,
  5. required Token endToken,
  6. required FeatureSet featureSet,
  7. required LineInfo lineInfo,
})

Initialize a newly created compilation unit to have the given directives and declarations. The scriptTag can be null if there is no script tag in the compilation unit. The list of directives can be null if there are no directives in the compilation unit. The list of declarations can be null if there are no declarations in the compilation unit.

Implementation

CompilationUnitImpl({
  required this.beginToken,
  required ScriptTagImpl? scriptTag,
  required List<DirectiveImpl>? directives,
  required List<CompilationUnitMemberImpl>? declarations,
  required this.endToken,
  required this.featureSet,
  required this.lineInfo,
}) : _scriptTag = scriptTag {
  _becomeParentOf(_scriptTag);
  _directives._initialize(this, directives);
  _declarations._initialize(this, declarations);
}