Closed nalply closed 10 months ago
I had this line use lexgen_utils::*;
in the code and removed it, then it worked.
Sorry, I don't understand what lexgen_utils does.
I found out, the Readme.md code at the top is missing use statements at the top, so I had to find out which one to insert and I got lost.
I've updated README with the use
statements. If you just copy-paste that code into a fn main() { <HERE> }
it should work.
lexgen_util
is the runtime library for lexgen-generated lexers. It contains types used commonly in all lexers. As the readme mentions, you should add lexgen_util
as a dependency with the same version of lexgen. E.g.
[dependencies]
lexgen = "0.15.0"
lexgen_util = "0.15.0" # <--- need to be the same version as `lexgen`
Feel free to open a PR with clarifications if you find README confusing on this.
Thanks for the amazing work! Let me work a little bit more then I might send you a pull request to clarify the Readme.
I tried to get started and copied the line 180 with the return_() method, but it didn't work.
I then studied the source code of Lexer and discovered that there is no such method, and used
SemtanticActionResult::Return(token)
instead.It seems that the example is outdated. Right?