4 ms·
Not just for parsers, you can walk any tree structure with a generator. For example turning a binary tree into a sorted iterable.
by mr_toad 4y ago
Not just for parsers, you can walk any tree structure with a generator. For example turning a binary tree into a sorted iterable.
- jitl 4y agoA bunch of Notion's text editing algorithms need to walk up and down our tree of blocks in a particular order. We implement those walks as generators.