EndConversationStatement object has wrong FirstTokenIndex value
ScriptDom version: 161.9123 Parser compatibility level: 150
Code example
END CONVERSATION @handle;
Actually, I noticed it on a longer IF-ELSE-END CONVERSATION piece of code, but here is the problem: FirstTokenIndex points not to END keyword but to @handle variable reference which is wrong. On screenshot below FirstTokenIndex should be 178, not 182.
LastTokenIndex points here to semicolon position which is correct.
I think the issue is that
https://github.com/microsoft/SqlScriptDOM/blob/d84cc30809b29cc5497809c2b0432bf23c412c69/SqlScriptDom/Parser/TSql/TSql90.g#L13602-L13612
is missing a UpdateTokenInfo for End and vResult.
it should be:
endConversationStatement returns [EndConversationStatement vResult = FragmentFactory.CreateFragment<EndConversationStatement>()]
{
ScalarExpression vConv;
}
: tEnd:End tConversation:Identifier vConv = expression
{
UpdateTokenInfo(vResult,tEnd);
Match(tConversation,CodeGenerationSupporter.Conversation);
vResult.Conversation = vConv;
}
endConversationArgumentsOpt[vResult]
;
It's a similar issue to #91, and from looking at the grammar files I feel it probably happens in a few other places.
up