-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AMBER parser had a "too strict" regex to extract values (#273)
This PR addresses issue #272. This issue exposed a nasty bug inside the regex pattern we used to extract sections in the amber output file. we are trying to match a sequence of type filed = int/float extracting the int/float corresponding to the field. Up till now, the pattern was fr' {field}\s+=\s+(\*+|{_FP_RE}|\d+)' were field was the string we want to extract the value for, and _FP_RE is defined to extract the float/int after the equal. The problem arises when the field and/or the value are not separated from the = sign by a space (as was the case in the issue). It's strange this didn't appear before! I just changed the + in \s+=\s+ to *. Thinking about it, this should not break anything else, but I can't be 100% sure and the tests should catch any "macro" problems eventually introduced with this PR.
- Loading branch information
1 parent
6e19d4e
commit 96d5a50
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters