You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The short explanation is that the procedural macro #[regex(<input>)] needs to be able to read the content of <intput> as compilation time, which is not possible at the moment.
If you want to reuse some regex, you can still use subpatterns, see #162.
Now, I just noticed that this should be documented somewhere in the book ^^', so I'll open an issue for that.
I have multiple lexers that use common, and lengthy, regexes. It would be nice to put each regex in a const and reference it in multiple times.
In general, Rust doesn't allow constants in macros because macros get evaluated first. But I though that a nested macro might work:
but I get:
Is it possible to define a regex string in one place and use it in multiple places?
The text was updated successfully, but these errors were encountered: