Files
sdk/pkg/front_end/parser_testcases/general/function_reference_kinds.dart.scanner.expect
Paul Berry 126c5fa680 Initial parser support for constructor tear-offs.
This CL adds parser support for use of `<typeArguments>` as a
selector.  This allows expressions like `List<int>` (type literal with
type arguments), `f<int>` (function tear-off with type arguments),
`C.m<int>` (static method tear-off with type arguments), `EXPR.m<int>`
(instance method tear-off with type arguments), and `EXPR<int>`
(tear-off of `.call` method with type arguments).

I will add parser support for `.new` as a constructor name in a
follow-up CL.

Change-Id: I157e732276421e8c3fd20c38c67ae9643993bd85
Bug: https://github.com/dart-lang/sdk/issues/46020, https://github.com/dart-lang/sdk/issues/46044.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197102
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-05-25 13:58:10 +00:00

12 lines
963 B
Plaintext

var simpleIdentifier = f<a, b>;
var method = f().m<a, b>;
var prefixedIdentifier = prefix.f<a, b>;
var three_identifiers = prefix.ClassName.m<a, b>;
var[KeywordToken] simpleIdentifier[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] method[StringToken] =[SimpleToken] f[StringToken]([BeginToken])[SimpleToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] prefixedIdentifier[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] three_identifiers[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]ClassName[StringToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
[SimpleToken]