Files
sdk/pkg/front_end/parser_testcases/patterns/object_otherIdentifier_on.dart.parser.expect
T
Paul Berry 7a5136032f Parser: test that objectPattern accepts OTHER_IDENTIFIER.
The type name in an object pattern is a `typeIdentifier`; in the spec
grammar, `typeIdentifier` includes `OTHER_IDENTIFIER`, which is defined as:

    OTHER_IDENTIFIER ::=
        `async` | `hide` | `of` | `on` | `show` | `sync` | `await` | `yield`

This adds tests to verify that all these identifiers are accepted as
type names in an object pattern.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I6b9d752e1b34f7bc93dedc4304f695e7cb42df48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292542
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-04-01 16:39:34 +00:00

10 lines
254 B
Plaintext

void f(x) {
var on() = x;
}
void[KeywordToken] f[StringToken]([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
var[KeywordToken] on[KeywordToken]([BeginToken])[SimpleToken] =[SimpleToken] x[StringToken];[SimpleToken]
}[SimpleToken]
[SimpleToken]