Add Scanner.#16
Conversation
|
Thanks a lot. I'll take a closer look this weekend and figure out how to integrate it (maybe make it a separate module alongside the current lexer).
Thanks. This made my day. :) 😊 |
|
A few features I forgot to describe:
It's not the most efficient possible implementation, but it should be more efficient than what's currently in the project. |
|
You can see an example of this feature in use here: https://github.com/dabrahams/ebnf-citron/blob/main/Sources/ebnf-citron/EBNFLexer.swift and here: https://github.com/dabrahams/ebnf-citron/blob/main/Sources/ebnf-citron/main.swift#L16-L23 |
|
This PR should be considered a draft until I report back. |
|
OK, reporting back; it works, FWIW. |
|
@roop Bump. I use this all the time. |
|
Thanks, @dabrahams. I hope to get around to integrating this in the next few days. |
|
I'm still on my own fork because this hasn't been merged. |
This is intended to be a replacement lexer; I hope it's of some use. I'm not attached to how or whether it is integrated. Of course I didn't make any of the examples use it, nor did I include tests, which should get done someday. I suggest that if backward compatibility is important to you that you simply reimplement CitronLexer in terms of Scanner.
Thanks for this project; it has basically been a joy to work with :-)