Yeah, I think the parser is more straightforward this way. I don't think my approach is really salvageable as long as the nested parse logic creates a new state machine (I have some idea of how it could be made to work, but it's basically a completely different approach to the entire parser...). Thankfully I was able to find an alternative approach to my case: instead of reparsing n times, I inject n copies of the directive contents into the parser input, with each copy wrapped by simpler state setting/state...
On further reflection, my patch doesn't fully fix the problems involved. I can now parse section headers in a nested parse in my directive, but paragraphs following my directive get attached wrong in the tree because the parsing state of the parent parse doesn't get properly synchronized with the new state arising in the nested parse. But for cases not involving nested parses I still think it's correct.
Change section handling to not rely on exceptions and reparsing