I’m writing a pair of modes, each one moderately simple, but mutually recursive – that is, mode A can contain block of B, which can contain A, which can contain B, and so on. They have relatively simple delimiters, like this:
This is the outer mode [[ inner mode -> more -> "" double-double-quotes put us back in outer mode [[double-square brackets are inner mode]] "" ]]
Unfortunately, trying to define this solely with the Multiplexing addon seems to result in an infinite loop (at least, I got a stack overflow, so I assume that it can’t cope with multiplexed modes that refer to each other, which is a pity), and defining it with the Simple Mode addon for one side works on the way down, but chokes when unwinding the stack. So it sounds like I have to do this myself.
So: are there any examples of this sort of mutually-recursive modes? And/or are there any halfway simple examples of inner modes? The docs aren’t super-clear on exactly how to write an inner mode, and the examples I’ve found so far (eg, markdown/xml) are a bit opaque. Examples would be very helpful, since this recursive containment is by far the most important aspect of these modes…