private static JetParsing createForByClause(SemanticWhitespaceAwarePsiBuilder builder) { final SemanticWhitespaceAwarePsiBuilderForByClause builderForByClause = new SemanticWhitespaceAwarePsiBuilderForByClause(builder); JetParsing jetParsing = new JetParsing(builderForByClause); jetParsing.myExpressionParsing = new JetExpressionParsing(builderForByClause, jetParsing) { @Override protected boolean parseCallWithClosure() { if (builderForByClause.getStackSize() > 0) { return super.parseCallWithClosure(); } return false; } @Override protected JetParsing create(SemanticWhitespaceAwarePsiBuilder builder) { return createForByClause(builder); } }; return jetParsing; }
static JetParsing createForTopLevel(SemanticWhitespaceAwarePsiBuilder builder) { JetParsing jetParsing = new JetParsing(builder); jetParsing.myExpressionParsing = new JetExpressionParsing(builder, jetParsing); return jetParsing; }