So, I have this language definition that is largely working.
It does some fun things. It only highlights the language’s primitives inside of a procedure definition. It only highlights the ‘then’ keyword when it is terminating an if statement(as is customary in the language).
It handles loops similarly, but I’ve run into an issue. I’d like it to highlight things like continue or break only inside of a loop, but if those things are in an if block, they aren’t highlighted because the scope doesn’t include that.
Do any of you have any advice for this? I can break up the encapsulating scope so that the if statements inside a loop are “special”, but I’d rather not do this as it strikes me as being less elegant than somehow crawling up the context-stack and checking to see if there’s an enclosing loop.