void () { if (atToken(PyTokenTypes.LBRACKET)) { final SyntaxTreeBuilder.Marker typeParamList = myBuilder.mark(); nextToken(); do { if (!parseTypeParameter()) { myBuilder.error(PyParsingBundle.message("PARSE.expected.type.parameter")); } if (atToken(PyTokenTypes.COMMA)) { nextToken(); } else if (!atToken(PyTokenTypes.RBRACKET)) { break; } } while (!atToken(PyTokenTypes.RBRACKET)); checkMatches(PyTokenTypes.RBRACKET, PyParsingBundle.message("PARSE.expected.symbols", ",", "]")); typeParamList.done(PyElementTypes.TYPE_PARAMETER_LIST); } }