A place to write down my thoughts as I work through a particular problem.
Part 1 Had a video call with Michael and was able to figure out what I need to do. I was actually pretty spot on with what reverse matching is supposed to be (I mean the name kind of says it all), but what I inferred from his suggestion is that my approach is inefficient. Instead of performing a reversing operation on the entire AST, his suggestion was to implement reverse variants of the following instructions: matchScalar, matchBitset, matchBuiltin, matchAnyNonNewline, and advance.
Continue reading ...A month or two ago I discovered that Swift’s fancy new regex builder and regex literals didn’t support lookbehinds, a feature I wanted for a project I’m working on. I decided to see what it would take to implement it myself and slowly worked my way to a (sort-of) (mostly) working initial implementation. Michael Ilseman (one of the original authors of the Swift 5. 7 regex work) has been kindly giving me pointers that were essential for getting as far as I have. In his eyes, the core concept behind lookbehinds, is reverse matching. This is the focus of this scratchpad.
Continue reading ...