Closed thron7 closed 5 years ago
Hmm...this is usually an issue of cycles in a data structure that ST is trying to display. There is a debug mode I believe that tracks this stuff, at least in Java version.
Ok, I havn't found much about debugging for ST 4 (most pertains to ST 3). The docs suggest the Inspector GUI but using that before my render() call runs into the same SOE. There is a debug option in the Interpreter class, but I never instantiated that directly. How would I deploy a custom Interpreter instance? Or is there a better way?
can't remember. i seem to recall a global static you can set or whatever that tells it to track and look for inf recursion. sorry I can't be more specific.
No worries. I don't seem to be able to find it, but I have a work-around so I'm not stuck. You might close this, I just wanted to let somebody know. I read something about dynamic scoping in StringTemplate so maybe there is some variable capture going on, but I know too little about ST to follow up. - Thanks anyway.
I'm not sure if this is an ST or Antlr issue. But since the SOE appears in the ST code, I'm posting it here.
I'm working on Antlr parse tree visitors that return ST templates. In my own class deriving from AbstractParseTreeVisitor I'm overriding
defaultResult
andaggregateResult
, to collect all sub-results from multiple node children. I just want to collect them so they are not lost while going in and out of visiting the tree. Here is my code:Without the call to
st.add()
indefaultResult()
I get a SOE like this:or this
Am I doing something wrong here? Or is it in fact a bug? It feels like I would be inserting a template into itself, but I can't see where this should happen. And why would the
st.add()
call fix it?!This is Antlr 4.7.2 and StringTemplate 4.0.2.