void (@Nullable SyntaxTreeBuilder.Marker endMarker, @Nullable IElementType elType) { if (myBuilder.getTokenType() == PyTokenTypes.STATEMENT_BREAK) { myBuilder.advanceLexer(); final SyntaxTreeBuilder.Marker marker = myBuilder.mark(); final boolean indentFound = myBuilder.getTokenType() == PyTokenTypes.INDENT; if (indentFound) { myBuilder.advanceLexer(); while (!myBuilder.eof() && myBuilder.getTokenType() != PyTokenTypes.DEDENT) { parseStatement(); } } else { myBuilder.error(PyParsingBundle.message("indent.expected")); } marker.done(PyElementTypes.STATEMENT_LIST); marker.setCustomEdgeTokenBinders(LeadingCommentsBinder.INSTANCE, FollowingCommentBinder.INSTANCE); if (endMarker != null) { endMarker.done(elType); } if (indentFound && !myBuilder.eof()) { assert myBuilder.getTokenType() == PyTokenTypes.DEDENT; myBuilder.advanceLexer(); } } else { final SyntaxTreeBuilder.Marker marker = myBuilder.mark(); if (myBuilder.eof()) { myBuilder.error(PyParsingBundle.message("expected.statement")); } else { final ParsingContext context = getParsingContext(); context.pushScope(context.getScope().withSuite()); parseSimpleStatement(); context.popScope(); while (matchToken(PyTokenTypes.SEMICOLON)) { if (matchToken(PyTokenTypes.STATEMENT_BREAK)) { break; } context.pushScope(context.getScope().withSuite()); parseSimpleStatement(); context.popScope(); } } marker.done(PyElementTypes.STATEMENT_LIST); if (endMarker != null) { endMarker.done(elType); } } }