Hacker News new | past | comments | ask | show | jobs | submit login

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...

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 ;)




Thanks 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/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: