added alternative guard conditions for

AntlrContentAssistGrammarGenerator
This commit is contained in:
overflowerror 2021-11-27 16:25:16 +01:00
parent 58e3bba502
commit 6055348451
2 changed files with 3 additions and 1 deletions

View file

@ -161,7 +161,7 @@ class AntlrContentAssistGrammarGenerator extends AbstractAntlrGrammarWithActions
int stackSize = keepStackSize();
}
:
«FOR element : elements SEPARATOR '\n|'»«element.ebnf(options, false)»«ENDFOR»
«FOR element : elements SEPARATOR '\n|'»«element.findGuardForElement.renderPredicate»«element.ebnf(options, false)»«ENDFOR»
;
finally {
restoreStackSize(stackSize);

View file

@ -432,6 +432,8 @@ public class AntlrContentAssistGrammarGenerator extends AbstractAntlrGrammarWith
} else {
_builder.appendImmediate("\n|", "\t");
}
String _renderPredicate = this._hoistingProcessor.findGuardForElement(element).renderPredicate();
_builder.append(_renderPredicate, "\t");
String _ebnf = this.ebnf(element, options, false);
_builder.append(_ebnf, "\t");
}