I made this transpiler while watching the Destroy All Software screencast A Compiler From Scratch.
Instead of following along in Ruby, I decided to follow along in Rust. Due to the nature of rust, This has lead to a few significantly different design decisions, but overall it works the same way.
- Make
token_kindsSTATIC? - Better way to do sub-types of Token?
cargo runcargo testA helpful command in vim:
:nmap <leader>t :w \| !clear && RUST_BACKTRACE=1 ncargo test<CR>
Then type ,t to run tests from inside vim.
cargo fmtcargo clippy