fixed parse doctests by sorting the grammar productions