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

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

Merged
merged 3 commits into from
Apr 26, 2023

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!

logos-codegen/src/mir.rs Outdated Show resolved Hide resolved
logos-codegen/src/mir.rs Outdated Show resolved Hide resolved
logos-codegen/src/mir.rs Outdated Show resolved Hide resolved
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
10 checks passed
@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.

None yet

2 participants