According to timestamps, I last worked on Carrot in 2022. That feels about right, given how much reminding-myself I had to do in order to make good changes to the code.

Also, irritatingly, I clearly left off at the halfway point of a refactor, where I was decoupling the lexer and parser into standalone modules. I had done the lexer, I had not done a thing to the parser. Arguably they don’t need to be separate at all, but I tend to think that strong separation of concerns is always a good thing, even when the end product is likely to appear monolithic.

So today I spent several hours moving that along, because I shall be very cross with myself if I don’t get a working version of Carrot out the door before I die.

The refactor isn’t complete now, but both lexer and parser are passing tests again, and a lot of sanity-checking has been done in terms of which code is in which module – it’s clear that on my initial pass I just threw stuff at the lexer quite haphazardly in order to get it working standalone.

Now things are much cleaner on both sides, but the parser needs a great big variable name overhaul (something that 4-years-ago me did to the lexer). When I was writing the original version of this code, I was clearly still under the influence of the “systems programs must have disgustingly compact names” disease that also infected Petrel.

And after that I’ll restart work on the parser’s testing suite, which has a long way to go and so many error cases to validate.

Also, I’ll try to write up a good overview of what this project is meant to be. And start writing about Thrasher as well!