A Poorman's Rust Enum in Python for ThePrimeagen's Lexer
A couple of months ago, I came across a video where the prolific streamer and Netflix dev known online as the ThePrimeagen live-coded a simple lexer for an interpreter inspired by the book Crafting Interpreters by Robert Nystrom. If you’ve ever looked into what CPython actually does with your source code, you’ll know that it parses the code into an abstract syntax tree, converts the tree into bytecode instructions (i.e. those *....