-
Notifications
You must be signed in to change notification settings - Fork 832
Fix for offside errors on interpolated expressions #15393
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
Fix for offside errors on interpolated expressions #15393
Conversation
a6d0177 to
62f3256
Compare
6b0c47b to
cc8071f
Compare
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
cc8071f to
af5d478
Compare
We do not really care about interpolated string end token being offside in relation to the interpolated string beginning. Not sure if not inserting dummy token is right fix here though.
af5d478 to
4252e22
Compare
|
@auduchinok given that you have done a lot of work in the parser - I can't think of any case that this change would break and it seems to fix the original issue as expected. However, I have difficult time fully wrapping my head around how the contexts' stack is used by |
No, from the top of my head, I don't expect anything to break from these changes. |
|
@abonie Could you, maybe, add some parser tests, so we have a particular tree structure captured with these changes? |
|
Neat, I didn't know about the Added some syntax tree tests. |
Fixes: #13728
The problem occurred when
INTERP_STRING_ENDtoken was offside in relation toINTERP_STRING_BEGIN_PARTtoken. Too many contexts would be taken off the offside stack inhwFetchTokeninLexFilterwhich would result in unfinished block error.It seems to me that in case of interpolated strings, we can completely skip closing surrounding contexts.