constructorInvocationWithTypeArguments method
Constructor invocation without new or const that has type arguments
(Foo<int>(...) or Foo<int>.named(...)).
Implementation
Parser<InvocationExpressionNode> constructorInvocationWithTypeArguments() =>
seq4(
ref0(qualifiedIdentifier),
ref0(typeArguments),
(ref1(token, '.') & ref0(identifier))
.map((l) => l[1] as String)
.optional(),
ref0(argumentList),
).map4((name, typeArgs, ctorName, args) {
ExpressionNode target = IdentifierNode(name);
if (ctorName != null) {
target = PropertyAccessNode(target: target, propertyName: ctorName);
}
return InvocationExpressionNode(
target: target,
typeArguments: typeArgs,
arguments: args,
);
});