void () { assert atToken(PyTokenTypes.LPAR); final SyntaxTreeBuilder.Marker listMark = myBuilder.mark(); myBuilder.advanceLexer(); final ExpressionParsing exprParser = getExpressionParser(); int paramCount = 0; while (!(atAnyOfTokens(PyTokenTypes.RPAR, PyTokenTypes.RARROW, PyTokenTypes.STATEMENT_BREAK) || myBuilder.eof()) ) { if (paramCount > 0) { checkMatches(PyTokenTypes.COMMA, PyParsingBundle.message("PARSE.expected.comma")); } boolean parsed; if (atToken(PyTokenTypes.MULT)) { final SyntaxTreeBuilder.Marker starMarker = myBuilder.mark(); myBuilder.advanceLexer(); parsed = exprParser.parseSingleExpression(false); starMarker.done(PyElementTypes.STAR_EXPRESSION); } else if (atToken(PyTokenTypes.EXP)) { final SyntaxTreeBuilder.Marker doubleStarMarker = myBuilder.mark(); myBuilder.advanceLexer(); parsed = exprParser.parseSingleExpression(false); doubleStarMarker.done(PyElementTypes.DOUBLE_STAR_EXPRESSION); } else { parsed = exprParser.parseSingleExpression(false); } if (!parsed) { myBuilder.error(PyParsingBundle.message("PARSE.expected.expression")); recoverUntilMatches(PyParsingBundle.message("PARSE.expected.expression"), PyTokenTypes.COMMA, PyTokenTypes.RPAR, PyTokenTypes.RARROW, PyTokenTypes.STATEMENT_BREAK); } paramCount++; } checkMatches(PyTokenTypes.RPAR, PyParsingBundle.message("PARSE.expected.rpar")); listMark.done(PyFunctionTypeAnnotationElementTypes.PARAMETER_TYPE_LIST); }