Hence my question, why are you doing something different, why not just put the original back since its in upstream?
Isn't the purpose of this whole exercise to sync with upstream?
It is, but I'm not sure upstream itself shouldn't be changed. The most important reason why this is a problem is that with this behavior the parser output is semantically different from other parsers -- not to mention that it's then harder to distinguish children of identically-named sections.
But yeah, the PR here is just one solution, and we can and probably should use upstream's, changed or not.