-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
proc-macro derive panicked message: attempt to subtract with overflow #389
Comments
Hello @UnexDev, can you please provide the error message too? the faulty line is probably showed in there :) |
I do think I found the error. It's an enum length problem. When I comment out every line until the error goes away it compiles just fine. When I uncomment one line, it errors. The enum is too long I believe.
I omitted irrelevant details before, but here is the full error message.
|
The problem seems to be an excessive amount of tokens combined with a repeating operator present somewhere in the string: #[derive(Debug, Logos)]
pub enum TokenKind {
#[regex("aaaaaaaaaaaaaa*")]
SmallLiteral,
} |
I'm converting a YACC grammar file to a Logos lexer, and I'm getting this strange and very unhelpful error message. Every macro-debug process I have tried has literally yielded no additional output.
(All of the RegExps are not complete; I am going to find-and-replace all of the reocurring works like 'skip' and 'StringLiteralSingle')
The text was updated successfully, but these errors were encountered: