< Home | Recrafted | Blog | About >
On
While writing that article, I came across a fairly critical bug that in said article I glossed over because fixing it meant rewriting the entire code processor. The time has come, though, and I had to write a preemption implementation for Cynosure 2.
The code for that is here. You may follow along if you wish.
So what's different about this new code?
As with the previous implementation, there is a table of patterns; the primary difference is that there are more of them. They also use Cynosure 2's randomized
After that table there is the
Then there is the
This function takes in a chunk of code. It iterates through that chunk of code and finds either a quote (
When it finds a quote, it will flip the internal variable
When it finds an open bracket:
This logic is a little simpler than the previous implementation, and doesn't freak out over multiline strings with quotes in them. All-in-all I think it's a much-needed improvement.
Aside from the above stuff, everything in the previous article still applies to the original Cynosure.
I hope you learned something from this article. If you have any questions, message me at