boolean (PsiBuilder builder) { final PsiBuilder.Marker marker = builder.mark(); if (builder.getTokenType() == RegExpTT.LBRACE) { builder.advanceLexer(); final boolean minOmitted = builder.getTokenType() == RegExpTT.COMMA && myCapabilities.contains(RegExpCapability.OMIT_NUMBERS_IN_QUANTIFIERS); if (minOmitted) { builder.advanceLexer(); } else { if (builder.getTokenType() == RegExpTT.NUMBER) { final PsiBuilder.Marker numberMark = builder.mark(); builder.advanceLexer(); numberMark.done(RegExpElementTypes.NUMBER); } else { builder.error(RegExpBundle.message("parse.error.number.expected")); } } if (builder.getTokenType() == RegExpTT.RBRACE) { builder.advanceLexer(); parseQuantifierType(builder); marker.done(RegExpElementTypes.QUANTIFIER); } else { if (!minOmitted) { checkMatches(builder, RegExpTT.COMMA, RegExpBundle.message("parse.error.comma.expected")); } if (builder.getTokenType() == RegExpTT.RBRACE) { builder.advanceLexer(); parseQuantifierType(builder); marker.done(RegExpElementTypes.QUANTIFIER); } else if (builder.getTokenType() == RegExpTT.NUMBER) { final PsiBuilder.Marker numberMark = builder.mark(); builder.advanceLexer(); numberMark.done(RegExpElementTypes.NUMBER); checkMatches(builder, RegExpTT.RBRACE, RegExpBundle.message("parse.error.closing.brace.expected")); parseQuantifierType(builder); marker.done(RegExpElementTypes.QUANTIFIER); } else { builder.error(RegExpBundle.message("parse.error.closing.brace.or.number.expected")); marker.done(RegExpElementTypes.QUANTIFIER); return true; } } } else if (RegExpTT.QUANTIFIERS.contains(builder.getTokenType())) { builder.advanceLexer(); parseQuantifierType(builder); marker.done(RegExpElementTypes.QUANTIFIER); } else { marker.drop(); return false; } return true; }