|
|
|
|
|
|
Re: Cannot set backtrack to false [message #1823370 is a reply to message #1823362] |
Wed, 25 March 2020 15:30   |
Christian Sodomka Messages: 8 Registered: May 2019 |
Junior Member |
|
|
Uhh. This looks like an xtend bug to me! I experienced this before but not with templates.
Bad I cannot include snapshots here, but here is the code sniplet from AbstractAntlrGrammarGenerator (sorry for the bad characters):
protected def compileParserOptions(Grammar it, AntlrOptions options) '''
options {
�IF !isCombinedGrammar�
tokenVocab=�grammarNaming.getLexerGrammar(it).simpleName�;
�ENDIF�
�IF grammarNaming.getInternalParserSuperClass(it) !== null�
superClass=�grammarNaming.getInternalParserSuperClass(it).simpleName�;
�ENDIF�
�IF isParserBackTracking(options) || options.memoize || options.k >= 0�
�IF isParserBackTracking(options)�
backtrack=true;
�ENDIF�
�IF options.memoize�
memoize=true;
�ENDIF�
�IF options.k >= 0�
memoize=�options.k�;
�ENDIF�
>>>> �ENDIF�
}
'''
protected def isParserBackTracking(Grammar it, AntlrOptions options) {
options.backtrack
}
When you come to the point marked with ">>>>" the output is (copied from variable _builder.segments[]:
[
, options {,
, , tokenVocab=, InternalTabsLexer, ;,
, , superClass=, AbstractInternalContentAssistParser, ;,
, , backtrack=true;, !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
]
Which is an error according to debugged variable options.backtrack which is false
so isParserBackTracking(options) should never return true!
Had this xtend error before in normal xtend code with nested ifs. If you insert "{}" after the condition everything is fine, if not sometimes it goes into the nested if, even if the condition is false.
But you cannot do this here with template syntax!
So I am really stuck :-(
PS: uploaded the screenshots
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02983 seconds