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

Fork regex issue #59

Closed
mikolajpp opened this issue Dec 14, 2018 · 3 comments
Closed

Fork regex issue #59

mikolajpp opened this issue Dec 14, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@mikolajpp
Copy link
Contributor

I am not entirely sure, so lets first settle it here if it is a bug or not.
This works

#[regex="~s[0-9]+(\\.\\.[0-9a-f\\.]+)"]
#[regex="~s[0-9]+"]
LiteralRelDate

But collapsing the above regex into single one

#regex=["~[0-9]+(\\.\\.[0-9a-f\\.]+)?"]

Gives unexpected error on things that would otherwise match into LiteralRelDate in the former case.

@maciejhirsz maciejhirsz added the bug Something isn't working label Dec 14, 2018
@maciejhirsz
Copy link
Owner

Definitely a bug, can you provide tests / examples for breakage?

@mikolajpp
Copy link
Contributor Author

Will send a PR soon; One question though, how do you work around

--> tests/tests/properties.rs:2:5
  |
1 | use logos::Logos;
  |     ------------ previous import of the macro `Logos` here
2 | use logos_derive::Logos;
  |     ^^^^^^^^^^^^^^^^^^^ `Logos` reimported here
  |
  = note: `Logos` must be defined only once in the macro namespace of this module
help: you can use `as` to change the binding name of the import
  |
2 | use logos_derive::Logos as OtherLogos;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

or do you not see it? I am working from nigthly, and for every PR I have to comment it out
the use logos_derive for testing, and then turn it back on.

@maciejhirsz
Copy link
Owner

Use ./test.sh or call cargo test from within the tests directory. It's pulling in logos with default-features = false so it can import the derive macro separately, but cargo ignores it when running tests on the workspace level.

maciejhirsz added a commit that referenced this issue Dec 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants