Skip to content

chore(codegen): error to prevent undesired behavior#303

Merged
maciejhirsz merged 3 commits intomaciejhirsz:masterfrom
jeertmans:test
Apr 26, 2023
Merged

chore(codegen): error to prevent undesired behavior#303
maciejhirsz merged 3 commits intomaciejhirsz:masterfrom
jeertmans:test

Conversation

@jeertmans
Copy link
Collaborator

Hi @maciejhirsz !

This PR follows what was discussed in #302.

I added a small check in logos-codegen to check for .* or .+ patterns. When found, an error is raised with a helpful message that redirects to a solution.

I hope the implementation is correct (especially for non-utf8 cases and the fact that I also added a check for .+).

NOTES

  1. I had to move the doc tests from tests/tests/binary.rs to tests/src/lib.rs because I don't think they were ever executed;
  2. I think that the pattern you mentioned in Incorrect regex #302 (comment), namely r"\([^)]*\)", is missing an \ to escape the inner );
  3. and I added new tests that assert a compile error is raised for the given cases.

Copy link
Owner

@maciejhirsz maciejhirsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

@jeertmans jeertmans requested a review from maciejhirsz April 26, 2023 11:18
Copy link
Owner

@maciejhirsz maciejhirsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers!

@maciejhirsz maciejhirsz merged commit 61c6e1d into maciejhirsz:master Apr 26, 2023
@jeertmans jeertmans deleted the test branch April 26, 2023 13:24
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.

2 participants