Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EndConversationStatement object has wrong FirstTokenIndex value #90

Open
IVNSTN opened this issue Aug 20, 2024 · 1 comment
Open

EndConversationStatement object has wrong FirstTokenIndex value #90

IVNSTN opened this issue Aug 20, 2024 · 1 comment

Comments

@IVNSTN
Copy link

IVNSTN commented Aug 20, 2024

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.

image

LastTokenIndex points here to semicolon position which is correct.

@IVNSTN IVNSTN changed the title EndConversation object has wrong FirstTokenIndex value EndConversationStatement object has wrong FirstTokenIndex value Aug 20, 2024
@vemoo
Copy link

vemoo commented Aug 27, 2024

I think the issue is that

endConversationStatement returns [EndConversationStatement vResult = FragmentFactory.CreateFragment<EndConversationStatement>()]
{
ScalarExpression vConv;
}
: End tConversation:Identifier vConv = expression
{
Match(tConversation,CodeGenerationSupporter.Conversation);
vResult.Conversation = vConv;
}
endConversationArgumentsOpt[vResult]
;

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants