start, name, false, isGenerator,
FunctionDeclarationTree.Kind.EXPRESSION);
}
private FormalParameterListTree parseFormalParameterList() {
SourcePosition listStart = getTreeStartLocation();
eat(TokenType.OPEN_PAREN);
// FormalParameterList :
// ... Identifier
// FormalParameterListNoRest
// FormalParameterListNoRest , ... Identifier
//
// FormalParameterListNoRest :
// Identifier
// Identifier = AssignmentExprssion
// FormalParameterListNoRest , Identifier
ImmutableList.Builder<ParseTree> result = ImmutableList.builder();
while (peek(TokenType.SPREAD) || peekId()
|| peek(TokenType.OPEN_SQUARE) || peek(TokenType.OPEN_CURLY)) {
SourcePosition start = getTreeStartLocation();
if (peek(TokenType.SPREAD)) {
eat(TokenType.SPREAD);
result.add(new RestParameterTree(getTreeLocation(start), eatId()));