That is pretty much exactly what I have so far (except that I parsed filter-style, rather than reading it all in at once). It fails to handle lists utterly however, as it sees them as sections...
By reading them all in as you have done, I could conceivably backtrack and try again if assuming it was a section led to an error, but if this is better done with a "Real" parser I don't want to reinvent the wheel. However, since I have almost no "real" parser experience, I don't know if this is an appropriate situation for one or not.