goffrie / plex

a parser and lexer generator as a Rust procedural macro
Apache License 2.0
410 stars 28 forks source link

Token lifetime in parser #40

Open kaimast opened 4 years ago

kaimast commented 4 years ago

Hi,

If I add a lifetime to my token enum like in the README, I have a hard time compiling the parser. Essentially I get the following error.

error[E0106]: missing lifetime specifier
src/parser/mod.rs:53:19
53 |         fn parse_(Token, Span);
     |                   ^^^^^ help: consider giving it an explicit bounded or 'static lifetime: `Token + 'static`

How do I add a lifetime here? The syntax of this macro is a little confusing...