Unit test fixes

unit test fixes, including:
- fixed parse doctests by sorting the grammar productions