4 ms·
If you want to see what a lexical analyzer looks like in Rust, here's one that I wrote for Lua: https://github.com/aswyk/oxidation/blob/master/oxidation/src/le
by groovy2shoes 11y ago
If you want to see what a lexical analyzer looks like in Rust, here's one that I wrote for Lua:
https://github.com/aswyk/oxidation/blob/master/oxidation/src/lexer/reader.rs https://github.com/aswyk/oxidation/blob/master/oxidation/src...
Of course, Rust's own lexer is also written in Rust.
ETA: I can't promise my lexer is actually any good... it's really the first non-trivial thing I've written in Rust. But it works ;)
- gnuvince 11y agoThanks for that link! I'm currently writing a compiler for a minuscule language[1] and it's great to be able to look at how other people tackle the same problem and learn. [1] https://github.com/gnuvince/minilang-rs/ https://github.com/gnuvince/minilang-rs/