CommaSeparation (@NotNull BooleanSupplier patternParser) { CommaSeparation result = CommaSeparation.NO_ELEMENTS; boolean afterPattern = patternParser.getAsBoolean(); if (afterPattern || atToken(PyTokenTypes.COMMA)) { result = CommaSeparation.SINGLE_NO_COMMA; while (atToken(PyTokenTypes.COMMA)) { result = CommaSeparation.EXISTS; if (!afterPattern) { myBuilder.error(PyParsingBundle.message("PARSE.expected.pattern")); } nextToken(); afterPattern = patternParser.getAsBoolean(); if (!afterPattern && !atToken(PyTokenTypes.COMMA)) { break; } } } return result; }