Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix whitespace character class tests #5522

Closed

Conversation

anthony-chang
Copy link
Contributor

  • Previously, the python tests for whitespace \s and \S were not testing the intended code path. This PR fixes it by using double backslashes
  • The fuzz tests caught a case we were not handling when a predefined character class is used immediately after a string anchor (eg. the pattern a\Z\V) which caused the transpilation to be incorrect. To fix this, I moved the rewriting of character classes \s, \S, \v, \V, \h, \H to the rewrite() stage and factored out the logic handle negated character classes

Signed-off-by: Anthony Chang antchang@nvidia.com

…s expansion to rewrite

Signed-off-by: Anthony Chang <antchang@nvidia.com>
Signed-off-by: Anthony Chang <antchang@nvidia.com>
@anthony-chang anthony-chang self-assigned this May 18, 2022
@anthony-chang
Copy link
Contributor Author

build

@sameerz
Copy link
Collaborator

sameerz commented May 18, 2022

I think there are two separate changes in this PR, one for tests (related to whitespace) and one for a bug ( not handling when a predefined character class is used immediately after a string anchor ). The changes ought to be in separate PRs.

revans2
revans2 previously approved these changes May 18, 2022
andygrove
andygrove previously approved these changes May 18, 2022
…into whitespace-tests

Signed-off-by: Anthony Chang <antchang@nvidia.com>
@anthony-chang anthony-chang dismissed stale reviews from andygrove and revans2 via ee735e1 May 18, 2022 16:21
@anthony-chang
Copy link
Contributor Author

Will split into two separate PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants