Merge pull request #643 from jskda/pull_request.unit_test_fixes

Unit test fixes
fixed parse doctests by sorting the grammar productions