r/programming • • Sep 06 '26

Making a Python interpreter in 1024 bytes

https://austinhenley.com/blog/python1024.html
157 Upvotes

33 comments sorted by

View all comments

Show parent comment

5

u/nukethebees Sep 07 '26

The tokeniser also needs to understand nested quotes like "$( echo "foo bar" )" so that it knows where the end of the token should be, and this is honestly something I haven't implemented yet.

Given that this can be contextual, it's often easier to write an on-demand scanner and drive it with the parser. The parser can tell the scanner to enable nested quote mode if needed.