126c5fa680
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>
207 lines
11 KiB
Plaintext
207 lines
11 KiB
Plaintext
parseUnit(var)
|
|
skipErrorTokens(var)
|
|
listener: beginCompilationUnit(var)
|
|
syntheticPreviousToken(var)
|
|
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
|
|
parseMetadataStar()
|
|
listener: beginMetadataStar(var)
|
|
listener: endMetadataStar(0)
|
|
parseTopLevelMemberImpl()
|
|
listener: beginTopLevelMember(var)
|
|
parseFields(, null, null, null, null, null, var, var, Instance of 'NoType', simpleIdentifier, DeclarationKind.TopLevel, null, false)
|
|
listener: beginFields()
|
|
listener: handleNoType(var)
|
|
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
|
|
listener: handleIdentifier(simpleIdentifier, topLevelVariableDeclaration)
|
|
parseFieldInitializerOpt(simpleIdentifier, simpleIdentifier, null, null, null, var, DeclarationKind.TopLevel, null)
|
|
listener: beginFieldInitializer(=)
|
|
parseExpression(=)
|
|
parsePrecedenceExpression(=, 1, true)
|
|
parseUnaryExpression(=, true)
|
|
parsePrimary(=, expression)
|
|
parseSendOrFunctionLiteral(=, expression)
|
|
parseSend(=, expression)
|
|
isNextIdentifier(=)
|
|
ensureIdentifier(=, expression)
|
|
listener: handleIdentifier(f, expression)
|
|
listener: handleNoTypeArguments(<)
|
|
parseArgumentsOpt(f)
|
|
listener: handleNoArguments(<)
|
|
listener: handleSend(f, <)
|
|
listener: beginTypeArguments(<)
|
|
listener: handleIdentifier(a, typeReference)
|
|
listener: handleNoTypeArguments(,)
|
|
listener: handleType(a, null)
|
|
listener: handleIdentifier(b, typeReference)
|
|
listener: handleNoTypeArguments(>)
|
|
listener: handleType(b, null)
|
|
listener: endTypeArguments(2, <, >)
|
|
listener: handleTypeArgumentApplication(<)
|
|
listener: endFieldInitializer(=, ;)
|
|
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
|
|
listener: endTopLevelDeclaration(var)
|
|
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
|
|
parseMetadataStar(;)
|
|
listener: beginMetadataStar(var)
|
|
listener: endMetadataStar(0)
|
|
parseTopLevelMemberImpl(;)
|
|
listener: beginTopLevelMember(var)
|
|
parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', method, DeclarationKind.TopLevel, null, false)
|
|
listener: beginFields(;)
|
|
listener: handleNoType(var)
|
|
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
|
|
listener: handleIdentifier(method, topLevelVariableDeclaration)
|
|
parseFieldInitializerOpt(method, method, null, null, null, var, DeclarationKind.TopLevel, null)
|
|
listener: beginFieldInitializer(=)
|
|
parseExpression(=)
|
|
parsePrecedenceExpression(=, 1, true)
|
|
parseUnaryExpression(=, true)
|
|
parsePrimary(=, expression)
|
|
parseSendOrFunctionLiteral(=, expression)
|
|
looksLikeFunctionBody(.)
|
|
parseSend(=, expression)
|
|
isNextIdentifier(=)
|
|
ensureIdentifier(=, expression)
|
|
listener: handleIdentifier(f, expression)
|
|
listener: handleNoTypeArguments(()
|
|
parseArgumentsOpt(f)
|
|
parseArguments(f)
|
|
parseArgumentsRest(()
|
|
listener: beginArguments(()
|
|
listener: endArguments(0, (, ))
|
|
listener: handleSend(f, .)
|
|
parsePrimary(., expressionContinuation)
|
|
parseSendOrFunctionLiteral(., expressionContinuation)
|
|
parseSend(., expressionContinuation)
|
|
isNextIdentifier(.)
|
|
ensureIdentifier(., expressionContinuation)
|
|
listener: handleIdentifier(m, expressionContinuation)
|
|
listener: handleNoTypeArguments(<)
|
|
parseArgumentsOpt(m)
|
|
listener: handleNoArguments(<)
|
|
listener: handleSend(m, <)
|
|
listener: handleEndingBinaryExpression(.)
|
|
listener: beginTypeArguments(<)
|
|
listener: handleIdentifier(a, typeReference)
|
|
listener: handleNoTypeArguments(,)
|
|
listener: handleType(a, null)
|
|
listener: handleIdentifier(b, typeReference)
|
|
listener: handleNoTypeArguments(>)
|
|
listener: handleType(b, null)
|
|
listener: endTypeArguments(2, <, >)
|
|
listener: handleTypeArgumentApplication(<)
|
|
listener: endFieldInitializer(=, ;)
|
|
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
|
|
listener: endTopLevelDeclaration(var)
|
|
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
|
|
parseMetadataStar(;)
|
|
listener: beginMetadataStar(var)
|
|
listener: endMetadataStar(0)
|
|
parseTopLevelMemberImpl(;)
|
|
listener: beginTopLevelMember(var)
|
|
parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', prefixedIdentifier, DeclarationKind.TopLevel, null, false)
|
|
listener: beginFields(;)
|
|
listener: handleNoType(var)
|
|
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
|
|
listener: handleIdentifier(prefixedIdentifier, topLevelVariableDeclaration)
|
|
parseFieldInitializerOpt(prefixedIdentifier, prefixedIdentifier, null, null, null, var, DeclarationKind.TopLevel, null)
|
|
listener: beginFieldInitializer(=)
|
|
parseExpression(=)
|
|
parsePrecedenceExpression(=, 1, true)
|
|
parseUnaryExpression(=, true)
|
|
parsePrimary(=, expression)
|
|
parseSendOrFunctionLiteral(=, expression)
|
|
parseSend(=, expression)
|
|
isNextIdentifier(=)
|
|
ensureIdentifier(=, expression)
|
|
listener: handleIdentifier(prefix, expression)
|
|
listener: handleNoTypeArguments(.)
|
|
parseArgumentsOpt(prefix)
|
|
listener: handleNoArguments(.)
|
|
listener: handleSend(prefix, .)
|
|
parsePrimary(., expressionContinuation)
|
|
parseSendOrFunctionLiteral(., expressionContinuation)
|
|
parseSend(., expressionContinuation)
|
|
isNextIdentifier(.)
|
|
ensureIdentifier(., expressionContinuation)
|
|
listener: handleIdentifier(f, expressionContinuation)
|
|
listener: handleNoTypeArguments(<)
|
|
parseArgumentsOpt(f)
|
|
listener: handleNoArguments(<)
|
|
listener: handleSend(f, <)
|
|
listener: handleEndingBinaryExpression(.)
|
|
listener: beginTypeArguments(<)
|
|
listener: handleIdentifier(a, typeReference)
|
|
listener: handleNoTypeArguments(,)
|
|
listener: handleType(a, null)
|
|
listener: handleIdentifier(b, typeReference)
|
|
listener: handleNoTypeArguments(>)
|
|
listener: handleType(b, null)
|
|
listener: endTypeArguments(2, <, >)
|
|
listener: handleTypeArgumentApplication(<)
|
|
listener: endFieldInitializer(=, ;)
|
|
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
|
|
listener: endTopLevelDeclaration(var)
|
|
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
|
|
parseMetadataStar(;)
|
|
listener: beginMetadataStar(var)
|
|
listener: endMetadataStar(0)
|
|
parseTopLevelMemberImpl(;)
|
|
listener: beginTopLevelMember(var)
|
|
parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', three_identifiers, DeclarationKind.TopLevel, null, false)
|
|
listener: beginFields(;)
|
|
listener: handleNoType(var)
|
|
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
|
|
listener: handleIdentifier(three_identifiers, topLevelVariableDeclaration)
|
|
parseFieldInitializerOpt(three_identifiers, three_identifiers, null, null, null, var, DeclarationKind.TopLevel, null)
|
|
listener: beginFieldInitializer(=)
|
|
parseExpression(=)
|
|
parsePrecedenceExpression(=, 1, true)
|
|
parseUnaryExpression(=, true)
|
|
parsePrimary(=, expression)
|
|
parseSendOrFunctionLiteral(=, expression)
|
|
parseSend(=, expression)
|
|
isNextIdentifier(=)
|
|
ensureIdentifier(=, expression)
|
|
listener: handleIdentifier(prefix, expression)
|
|
listener: handleNoTypeArguments(.)
|
|
parseArgumentsOpt(prefix)
|
|
listener: handleNoArguments(.)
|
|
listener: handleSend(prefix, .)
|
|
parsePrimary(., expressionContinuation)
|
|
parseSendOrFunctionLiteral(., expressionContinuation)
|
|
parseSend(., expressionContinuation)
|
|
isNextIdentifier(.)
|
|
ensureIdentifier(., expressionContinuation)
|
|
listener: handleIdentifier(ClassName, expressionContinuation)
|
|
listener: handleNoTypeArguments(.)
|
|
parseArgumentsOpt(ClassName)
|
|
listener: handleNoArguments(.)
|
|
listener: handleSend(ClassName, .)
|
|
listener: handleEndingBinaryExpression(.)
|
|
parsePrimary(., expressionContinuation)
|
|
parseSendOrFunctionLiteral(., expressionContinuation)
|
|
parseSend(., expressionContinuation)
|
|
isNextIdentifier(.)
|
|
ensureIdentifier(., expressionContinuation)
|
|
listener: handleIdentifier(m, expressionContinuation)
|
|
listener: handleNoTypeArguments(<)
|
|
parseArgumentsOpt(m)
|
|
listener: handleNoArguments(<)
|
|
listener: handleSend(m, <)
|
|
listener: handleEndingBinaryExpression(.)
|
|
listener: beginTypeArguments(<)
|
|
listener: handleIdentifier(a, typeReference)
|
|
listener: handleNoTypeArguments(,)
|
|
listener: handleType(a, null)
|
|
listener: handleIdentifier(b, typeReference)
|
|
listener: handleNoTypeArguments(>)
|
|
listener: handleType(b, null)
|
|
listener: endTypeArguments(2, <, >)
|
|
listener: handleTypeArgumentApplication(<)
|
|
listener: endFieldInitializer(=, ;)
|
|
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
|
|
listener: endTopLevelDeclaration()
|
|
reportAllErrorTokens(var)
|
|
listener: endCompilationUnit(4, )
|