This makes the arguments to `ScannerConfiguration` required and uses the current enabled-by-default state as default.
Furthermore, an extension method is added for `ExperimentalFeatures` (and object already required by the parser) that creates the `ScannerConfiguration` based on the enabled features. This method is used throughout the analyzer and CFE, ensuring that the scanner is set up consistently with the parser.
Change-Id: Id51456d5a547b06d0925865e35e01d9dc7d65381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493760
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds an ExperimentalFeatures interface to make the parser able to know which experimental feature is currently supported. This generalizes the existing dependency on patterns and enhanced parts, and facilitates reporting of unsupported features directly within the parser, avoid the need for duplicate handling of this within analyzer+CFE.
Change-Id: If1752745ee4d753e4b463f2017f440223cd98737
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455700
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Modelled after the scanner_benchmark.
In jit mode it's currently at around 14 tokens/ms for
pkg/front_end/lib/src/type_inference/inference_visitor.dart
and 20 tokens/ms for pkg/analyzer/lib/src/dart/ast/ast.dart.
In aot mode it's currently at around 18 tokens/ms for
pkg/front_end/lib/src/type_inference/inference_visitor.dart
and 25 tokens/ms for pkg/analyzer/lib/src/dart/ast/ast.dart.
Change-Id: Ib080b68b99ddbddc16321237afb0d0d83fccdd11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439720
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>