pygdbmi icon indicating copy to clipboard operation
pygdbmi copied to clipboard

Refactor MI parsing to decrease the number of regex matches to perform

Open barisione opened this issue 3 years ago • 0 comments

  • [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

barisione avatar Aug 07 '22 17:08 barisione