Comment #9 on issue 2728 by [email protected]: count pairs of brackets http://code.google.com/p/lilypond/issues/detail?id=2728
It is probably also helpful for safe mode if the interpretation of a file does not continue in the same parser call into ly/init.ly (where safe mode is no longer active). For example, if you ended your file with \void, the first form in ly/init.ly following \maininput would just have gotten ignored.
