News for hackers. Stuff that matters.
Re:Crafting Interpreters is available in print by tyingq on Thursday July 29, 2021 @12:14PM (#27998141)
Somewhat related, I recently read about the undocumented tokenizer that comes with the python re module. https://www.reddit.com/r/ProgrammerTIL/comments/4tpt03/pytho...
Re:Crafting Interpreters is available in print by yatac42 on Thursday July 29, 2021 @03:08PM (#28000154)
Word of warning: The Scanner class does not adhere to the maximal munch rule, so you shouldn't use it to match keywords the way that it's done in the code in the linked reddit thread. If you replace the word "foobar" in the input with "truebar", it will then be tokenized as the keyword true followed by the identifier "bar", which is obviously not what you want.