#Help writing a lexer

5 messages · Page 1 of 1 (latest)

quiet arch
#

.chars() will get you an iterator over individual unicode characters. You may also want to look into some of the string convenience methods, such as split and strip_prefix.

(Note: writing an optimized lexer is an absolute nightmare: there's many many things you can do. Writing one that isn't needlessly inefficient is much easier, I advise doing that)

#

Also note that we have a crate to generate hyperoptimized lexers in only a few lines of code

#

?crate logos

warped spruceBOT
#

Create ridiculously fast Lexers

Version

0.12.1

Downloads

1 616 893

quiet arch
#

If you're doing this to learn, feel free to ignore it