boolean (final @NotNull BinaryOperationParser parser) { int prefixCount = 0; while (parser.getPrefixOperators().contains(parser.lookAhead(prefixCount))) { prefixCount++; } final PsiBuilder.Marker[] prefixMarkers = new PsiBuilder.Marker[prefixCount]; final IElementType[] elementTypes = new IElementType[prefixCount]; for (int i = 0; i < prefixCount; i++) { prefixMarkers[i] = parser.mark(); elementTypes[i] = parser.getPrefixExpressionElementType(); parser.advance(); } final boolean result = parser.parseSimpleExpression() || prefixCount > 0; for (int i = prefixCount - 1; i >= 0; i--) { parser.done(prefixMarkers[i], elementTypes[i]); } return result; }