[parser] Allow parsing top-level getter called get that's async/async*/sync*

Change-Id: I07e9759cdf61e1b633bbc0e7cd961d80ecfedf8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263129
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Jens Johansen 2022-10-14 11:21:48 +00:00 committed by Commit Queue
parent 7aeda010bf
commit 27e0e84cc3
11 changed files with 1158 additions and 43 deletions

View file

@ -149,7 +149,8 @@ abstract class IdentifierContext {
/// Identifier is the name being declared by a top level function declaration.
static const TopLevelDeclarationIdentifierContext
topLevelFunctionDeclaration = const TopLevelDeclarationIdentifierContext(
'topLevelFunctionDeclaration', const ['<', '(', '{', '=>']);
'topLevelFunctionDeclaration',
const ['<', '(', '{', '=>', 'async', 'sync']);
/// Identifier is the start of the name being declared by a method
/// declaration.

View file

@ -0,0 +1,8 @@
dynamic get get => throw "hello";
dynamic get get { throw "hello"; }
dynamic get get async => throw "hello";
dynamic get get async { throw "hello"; }
dynamic get get async* => throw "hello";
dynamic get get async* { throw "hello"; }
dynamic get get sync* => throw "hello";
dynamic get get sync* { throw "hello"; }

View file

@ -0,0 +1,148 @@
beginCompilationUnit(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(=>)
handleNoFormalParameters(=>, MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
endTopLevelMethod(dynamic, get, ;)
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(;, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables({)
handleNoFormalParameters({, MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod(dynamic, get, })
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(}, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, null)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
endTopLevelMethod(dynamic, get, ;)
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(;, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, null)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod(dynamic, get, })
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(}, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, *)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
handleInvalidStatement(=>, GeneratorReturnsValue)
endTopLevelMethod(dynamic, get, ;)
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(;, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, *)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod(dynamic, get, })
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(}, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(sync)
handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
handleAsyncModifier(sync, *)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
handleInvalidStatement(=>, GeneratorReturnsValue)
endTopLevelMethod(dynamic, get, ;)
endTopLevelDeclaration(dynamic)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginTopLevelMember(dynamic)
beginTopLevelMethod(;, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(get)
handleType(dynamic, null)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(sync)
handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
handleAsyncModifier(sync, *)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod(dynamic, get, })
endTopLevelDeclaration()
endCompilationUnit(8, )

View file

@ -0,0 +1,344 @@
parseUnit(dynamic)
skipErrorTokens(dynamic)
listener: beginCompilationUnit(dynamic)
syntheticPreviousToken(dynamic)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(, null, null, , Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(=>)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(=>, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(null, null)
inPlainSync()
inPlainSync()
parseFunctionBody(get, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: endTopLevelMethod(dynamic, get, ;)
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(;, null, null, ;, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(;, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables({)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters({, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(null, null)
inPlainSync()
inPlainSync()
parseFunctionBody(get, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(dynamic, get, })
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(}, null, null, }, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(}, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, null)
inPlainSync()
inPlainSync()
parseFunctionBody(async, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: endTopLevelMethod(dynamic, get, ;)
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(;, null, null, ;, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(;, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, null)
inPlainSync()
inPlainSync()
parseFunctionBody(async, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(dynamic, get, })
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(}, null, null, }, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(}, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: handleInvalidStatement(=>, GeneratorReturnsValue)
listener: endTopLevelMethod(dynamic, get, ;)
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(;, null, null, ;, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(;, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(dynamic, get, })
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(}, null, null, }, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(}, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(sync)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(sync, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: handleInvalidStatement(=>, GeneratorReturnsValue)
listener: endTopLevelMethod(dynamic, get, ;)
listener: endTopLevelDeclaration(dynamic)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(dynamic)
parseTopLevelMethod(;, null, null, ;, Instance of 'SimpleType', get, get, false)
listener: beginTopLevelMethod(;, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(get)
listener: handleType(dynamic, null)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(sync)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(sync, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(dynamic, get, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(dynamic)
listener: endCompilationUnit(8, )

View file

@ -0,0 +1,19 @@
dynamic get get => throw "hello";
dynamic get get { throw "hello"; }
dynamic get get async => throw "hello";
dynamic get get async { throw "hello"; }
dynamic get get async* => throw "hello";
dynamic get get async* { throw "hello"; }
dynamic get get sync* => throw "hello";
dynamic get get sync* { throw "hello"; }
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,19 @@
dynamic get get => throw "hello";
dynamic get get { throw "hello"; }
dynamic get get async => throw "hello";
dynamic get get async { throw "hello"; }
dynamic get get async* => throw "hello";
dynamic get get async* { throw "hello"; }
dynamic get get sync* => throw "hello";
dynamic get get sync* { throw "hello"; }
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
dynamic[KeywordToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
[SimpleToken]

View file

@ -11,14 +11,12 @@
// Getter called get.
(int a, String b) get get => (42, "fortytwo");
(int a, String b) get get { return (42, "fortytwo"); }
// The below is commented out for now --- probably that's a general
// parser bug that should be fixed.
// (int a, String b) get get async => throw "hello";
// (int a, String b) get get async { throw "hello"; }
// (int a, String b) get get async* => throw "hello";
// (int a, String b) get get async* { throw "hello"; }
// (int a, String b) get get sync* => throw "hello";
// (int a, String b) get get sync* { throw "hello"; }
(int a, String b) get get async => throw "hello";
(int a, String b) get get async { throw "hello"; }
(int a, String b) get get async* => throw "hello";
(int a, String b) get get async* { throw "hello"; }
(int a, String b) get get sync* => throw "hello";
(int a, String b) get get sync* { throw "hello"; }
// Getter called something else.
(int a, String b) get topLevelGetter => (42, "fortytwo");

View file

@ -423,6 +423,206 @@ beginCompilationUnit(()
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(}, null, null)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleIdentifier(a, recordFieldDeclaration)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments(b)
handleType(String, null)
handleIdentifier(b, recordFieldDeclaration)
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, null)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
endTopLevelMethod((, get, ;)
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(;, null, null)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleIdentifier(a, recordFieldDeclaration)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments(b)
handleType(String, null)
handleIdentifier(b, recordFieldDeclaration)
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, null)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod((, get, })
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(}, null, null)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleIdentifier(a, recordFieldDeclaration)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments(b)
handleType(String, null)
handleIdentifier(b, recordFieldDeclaration)
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, *)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
handleInvalidStatement(=>, GeneratorReturnsValue)
endTopLevelMethod((, get, ;)
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(;, null, null)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleIdentifier(a, recordFieldDeclaration)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments(b)
handleType(String, null)
handleIdentifier(b, recordFieldDeclaration)
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(async)
handleNoFormalParameters(async, MemberKind.TopLevelMethod)
handleAsyncModifier(async, *)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod((, get, })
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(}, null, null)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleIdentifier(a, recordFieldDeclaration)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments(b)
handleType(String, null)
handleIdentifier(b, recordFieldDeclaration)
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(sync)
handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
handleAsyncModifier(sync, *)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionFunctionBody(=>, ;)
handleInvalidStatement(=>, GeneratorReturnsValue)
endTopLevelMethod((, get, ;)
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(;, null, null)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleIdentifier(a, recordFieldDeclaration)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments(b)
handleType(String, null)
handleIdentifier(b, recordFieldDeclaration)
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleIdentifier(get, topLevelFunctionDeclaration)
handleNoTypeVariables(sync)
handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
handleAsyncModifier(sync, *)
beginBlockFunctionBody({)
beginLiteralString("hello")
endLiteralString(0, ;)
handleThrowExpression(throw, ;)
handleExpressionStatement(;)
endBlockFunctionBody(1, {, })
endTopLevelMethod((, get, })
endTopLevelDeclaration(()
beginMetadataStar(()
endMetadataStar(0)
beginTopLevelMember(()
beginTopLevelMethod(}, null, null)
beginRecordType(()
@ -2561,4 +2761,4 @@ beginCompilationUnit(()
endClassOrMixinOrExtensionBody(DeclarationKind.Class, 24, {, })
endClassDeclaration(class, })
endTopLevelDeclaration()
endCompilationUnit(20, )
endCompilationUnit(26, )

View file

@ -810,6 +810,392 @@ parseUnit(()
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod((, get, })
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(()
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(()
parseTopLevelMethod(}, null, null, }, Instance of 'ComplexTypeInfo', get, get, false)
listener: beginTopLevelMethod(}, null, null)
parseRecordType((, }, false)
listener: beginRecordType(()
parseRecordTypeField((, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(()
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(a)
listener: handleType(int, null)
ensureIdentifier(int, recordFieldDeclaration)
listener: handleIdentifier(a, recordFieldDeclaration)
listener: endRecordTypeEntry()
parseRecordTypeField(,, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(,)
listener: beginMetadataStar(String)
listener: endMetadataStar(0)
listener: handleIdentifier(String, typeReference)
listener: handleNoTypeArguments(b)
listener: handleType(String, null)
ensureIdentifier(String, recordFieldDeclaration)
listener: handleIdentifier(b, recordFieldDeclaration)
listener: endRecordTypeEntry()
listener: endRecordType((, null, 2, false)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, null)
inPlainSync()
inPlainSync()
parseFunctionBody(async, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: endTopLevelMethod((, get, ;)
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(()
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(()
parseTopLevelMethod(;, null, null, ;, Instance of 'ComplexTypeInfo', get, get, false)
listener: beginTopLevelMethod(;, null, null)
parseRecordType((, ;, false)
listener: beginRecordType(()
parseRecordTypeField((, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(()
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(a)
listener: handleType(int, null)
ensureIdentifier(int, recordFieldDeclaration)
listener: handleIdentifier(a, recordFieldDeclaration)
listener: endRecordTypeEntry()
parseRecordTypeField(,, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(,)
listener: beginMetadataStar(String)
listener: endMetadataStar(0)
listener: handleIdentifier(String, typeReference)
listener: handleNoTypeArguments(b)
listener: handleType(String, null)
ensureIdentifier(String, recordFieldDeclaration)
listener: handleIdentifier(b, recordFieldDeclaration)
listener: endRecordTypeEntry()
listener: endRecordType((, null, 2, false)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, null)
inPlainSync()
inPlainSync()
parseFunctionBody(async, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod((, get, })
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(()
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(()
parseTopLevelMethod(}, null, null, }, Instance of 'ComplexTypeInfo', get, get, false)
listener: beginTopLevelMethod(}, null, null)
parseRecordType((, }, false)
listener: beginRecordType(()
parseRecordTypeField((, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(()
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(a)
listener: handleType(int, null)
ensureIdentifier(int, recordFieldDeclaration)
listener: handleIdentifier(a, recordFieldDeclaration)
listener: endRecordTypeEntry()
parseRecordTypeField(,, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(,)
listener: beginMetadataStar(String)
listener: endMetadataStar(0)
listener: handleIdentifier(String, typeReference)
listener: handleNoTypeArguments(b)
listener: handleType(String, null)
ensureIdentifier(String, recordFieldDeclaration)
listener: handleIdentifier(b, recordFieldDeclaration)
listener: endRecordTypeEntry()
listener: endRecordType((, null, 2, false)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: handleInvalidStatement(=>, GeneratorReturnsValue)
listener: endTopLevelMethod((, get, ;)
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(()
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(()
parseTopLevelMethod(;, null, null, ;, Instance of 'ComplexTypeInfo', get, get, false)
listener: beginTopLevelMethod(;, null, null)
parseRecordType((, ;, false)
listener: beginRecordType(()
parseRecordTypeField((, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(()
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(a)
listener: handleType(int, null)
ensureIdentifier(int, recordFieldDeclaration)
listener: handleIdentifier(a, recordFieldDeclaration)
listener: endRecordTypeEntry()
parseRecordTypeField(,, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(,)
listener: beginMetadataStar(String)
listener: endMetadataStar(0)
listener: handleIdentifier(String, typeReference)
listener: handleNoTypeArguments(b)
listener: handleType(String, null)
ensureIdentifier(String, recordFieldDeclaration)
listener: handleIdentifier(b, recordFieldDeclaration)
listener: endRecordTypeEntry()
listener: endRecordType((, null, 2, false)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(async)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(async, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(async, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod((, get, })
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(()
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(()
parseTopLevelMethod(}, null, null, }, Instance of 'ComplexTypeInfo', get, get, false)
listener: beginTopLevelMethod(}, null, null)
parseRecordType((, }, false)
listener: beginRecordType(()
parseRecordTypeField((, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(()
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(a)
listener: handleType(int, null)
ensureIdentifier(int, recordFieldDeclaration)
listener: handleIdentifier(a, recordFieldDeclaration)
listener: endRecordTypeEntry()
parseRecordTypeField(,, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(,)
listener: beginMetadataStar(String)
listener: endMetadataStar(0)
listener: handleIdentifier(String, typeReference)
listener: handleNoTypeArguments(b)
listener: handleType(String, null)
ensureIdentifier(String, recordFieldDeclaration)
listener: handleIdentifier(b, recordFieldDeclaration)
listener: endRecordTypeEntry()
listener: endRecordType((, null, 2, false)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(sync)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(sync, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
parseExpressionFunctionBody(=>, false)
parseExpression(=>)
parseThrowExpression(=>, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionFunctionBody(=>, ;)
inGenerator()
listener: handleInvalidStatement(=>, GeneratorReturnsValue)
listener: endTopLevelMethod((, get, ;)
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(()
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(()
parseTopLevelMethod(;, null, null, ;, Instance of 'ComplexTypeInfo', get, get, false)
listener: beginTopLevelMethod(;, null, null)
parseRecordType((, ;, false)
listener: beginRecordType(()
parseRecordTypeField((, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(()
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(a)
listener: handleType(int, null)
ensureIdentifier(int, recordFieldDeclaration)
listener: handleIdentifier(a, recordFieldDeclaration)
listener: endRecordTypeEntry()
parseRecordTypeField(,, identifierIsOptional: true)
listener: beginRecordTypeEntry()
parseMetadataStar(,)
listener: beginMetadataStar(String)
listener: endMetadataStar(0)
listener: handleIdentifier(String, typeReference)
listener: handleNoTypeArguments(b)
listener: handleType(String, null)
ensureIdentifier(String, recordFieldDeclaration)
listener: handleIdentifier(b, recordFieldDeclaration)
listener: endRecordTypeEntry()
listener: endRecordType((, null, 2, false)
ensureIdentifierPotentiallyRecovered(get, topLevelFunctionDeclaration, false)
listener: handleIdentifier(get, topLevelFunctionDeclaration)
listener: handleNoTypeVariables(sync)
parseGetterOrFormalParameters(get, get, true, MemberKind.TopLevelMethod)
listener: handleNoFormalParameters(sync, MemberKind.TopLevelMethod)
parseAsyncModifierOpt(get)
listener: handleAsyncModifier(sync, *)
inPlainSync()
inPlainSync()
parseFunctionBody(*, false, false)
listener: beginBlockFunctionBody({)
notEofOrValue(}, throw)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclaration({, false)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
looksLikeLocalFunction(throw)
parseExpressionStatement({)
parseExpression({)
parseThrowExpression({, true)
parseExpression(throw)
parsePrecedenceExpression(throw, 1, true)
parseUnaryExpression(throw, true)
parsePrimary(throw, expression)
parseLiteralString(throw)
parseSingleLiteralString(throw)
listener: beginLiteralString("hello")
listener: endLiteralString(0, ;)
listener: handleThrowExpression(throw, ;)
ensureSemicolon("hello")
listener: handleExpressionStatement(;)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod((, get, })
listener: endTopLevelDeclaration(()
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(()
@ -5047,4 +5433,4 @@ parseUnit(()
listener: endClassDeclaration(class, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(()
listener: endCompilationUnit(20, )
listener: endCompilationUnit(26, )

View file

@ -10,14 +10,12 @@
(int a, String b) get get => (42, "fortytwo");
(int a, String b) get get { return (42, "fortytwo"); }
(int a, String b) get get async => throw "hello";
(int a, String b) get get async { throw "hello"; }
(int a, String b) get get async* => throw "hello";
(int a, String b) get get async* { throw "hello"; }
(int a, String b) get get sync* => throw "hello";
(int a, String b) get get sync* { throw "hello"; }
(int a, String b) get topLevelGetter => (42, "fortytwo");
@ -106,14 +104,12 @@ static (int a, String b) get staticGetter sync* { throw "hello"; }
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] =>[SimpleToken] ([BeginToken]42[StringToken],[SimpleToken] "fortytwo"[StringToken])[SimpleToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] {[BeginToken] return[KeywordToken] ([BeginToken]42[StringToken],[SimpleToken] "fortytwo"[StringToken])[SimpleToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] topLevelGetter[StringToken] =>[SimpleToken] ([BeginToken]42[StringToken],[SimpleToken] "fortytwo"[StringToken])[SimpleToken];[SimpleToken]

View file

@ -10,14 +10,12 @@
(int a, String b) get get => (42, "fortytwo");
(int a, String b) get get { return (42, "fortytwo"); }
(int a, String b) get get async => throw "hello";
(int a, String b) get get async { throw "hello"; }
(int a, String b) get get async* => throw "hello";
(int a, String b) get get async* { throw "hello"; }
(int a, String b) get get sync* => throw "hello";
(int a, String b) get get sync* { throw "hello"; }
(int a, String b) get topLevelGetter => (42, "fortytwo");
@ -106,14 +104,12 @@ static (int a, String b) get staticGetter sync* { throw "hello"; }
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] =>[SimpleToken] ([BeginToken]42[StringToken],[SimpleToken] "fortytwo"[StringToken])[SimpleToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] {[BeginToken] return[KeywordToken] ([BeginToken]42[StringToken],[SimpleToken] "fortytwo"[StringToken])[SimpleToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] async[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] =>[SimpleToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] get[KeywordToken] sync[KeywordToken]*[SimpleToken] {[BeginToken] throw[KeywordToken] "hello"[StringToken];[SimpleToken] }[SimpleToken]
([BeginToken]int[StringToken] a[StringToken],[SimpleToken] String[StringToken] b[StringToken])[SimpleToken] get[KeywordToken] topLevelGetter[StringToken] =>[SimpleToken] ([BeginToken]42[StringToken],[SimpleToken] "fortytwo"[StringToken])[SimpleToken];[SimpleToken]