Recently started a new project, it's a space-repetition system from markdown to CLI!
So far it's just a lexer and a parser, which aren't perfect, but are a little interesting, and a hash function.
The lexer yields tokens using re (which compiles to C) containing memoryviews over a mmap.
A larger regular expression is composed of smaller ones so they can be tested individually.
It should be quite fast, and use very little memory (for python).
The parser yields cards and is written as a state-machine, but in a "functional" style.
There are a number of parsers which return State, and they are dispatched to by TokenType.
They also accept a StateRepo which in this cases is implemented mutably, but could be immutable.
I was going to use pyrsistent for persistent datastructures but couldn't find any actual improvement in testability.
Anyway this thread will serve as yet another project log.
https://codeberg.org/jugaad/wikicards