2b79d2b747
Various cleanups to the TypeBuilder classes: TypeBuilder: * Remove `origin` parameter from TypeBuilder.build and instead make FunctionType.typedefType mutable and set if after creation. * Remove `charOffset` and `fileUri` parameters from TypeBuilder.buildSupertype/buildMixedInType * Remove `bind`, `resolveIn`, and `check` from TypeBuilder so that these are only present on NamedTypeBuilder * Remove TypeBuilder.buildTypeLiteralType and instead pass an argument to NamedTypeBuilder that determines what type to create on `build`. NamedTypeBuilder: * Make NamedTypeBuilder.instanceTypeVariableAccess private * Add NamedTypeBuilder.forDartType for prebuilt types * Add NamedTypeBuilder.forInvalidType for types created for errors * Make NamedTypeBuilder.declaration private and corresponding getter * Check most type use errors on NamedTypeBuilder.bind * Make NamedTypeBuilder helper methods private * Add `TypeVariableBuilder.isClassParameter` to support checking for valid type variable use through the `NamedTypeBuilder.bind` method. * Remove checking of type variable in static context from BodyBuilder since it is now checking on `NamedTypeBuilder.bind`. FunctionTypeBuilder: * Cache result of FunctionTypeBuilder.build TypeBuilderComputer: * Cache "constant" type declarations in TypeBuilderComputer Change-Id: Ibaedcb255487eecc5efe70b84e5cbd5a118c1e0b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239023 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
Front end for Dart
This package provides a low-level API for use by compiler back ends that wish to implement the Dart language. It is intended for eventual use by dev_compiler, dart2js, and the Dart VM. In addition, it will share implementation details with the analyzer package--this will be accomplished by having the analyzer package import (and re-export) parts of this package's private implementation.
End-users should use the dart analyze
command-line tool to analyze their Dart code.
Integrators that want to write tools that analyze Dart code should use the analyzer package.
Note: A previous version of this package was published on pub.dev. It has now been marked DISCONTINUED as it is not intended for direct consumption, as per the notes above.