pygdbmi
pygdbmi copied to clipboard
Refactor MI parsing to decrease the number of regex matches to perform
- [x] I have added an entry to
CHANGELOG.md
Summary of changes
The previous code to match MI records used to do matches twice. This PR simplifies the code (hopefully!) and means that matches need to happen only once.
Functionally, there should be no changes as I kept the regexes mostly identical and the same checks are executed in the same order.
“Mostly” because tokens used to be matched with (\d*) and are now matched with (\d+)? which I think makes it clearer to readers of the code that tokens are optional.
Test plan
Tested by running
nox -s tests