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

Various bugfixes in the grammar #13

Closed
wants to merge 6 commits into from

Conversation

apozharski
Copy link
Contributor

Hello,
There is currently a bug in grammar (more accurately the scanner/lexer) which causes errors when a multivariable assignment contains a line continuation between the lhs and the equals sign. For example:

function [] ...
    = f_ellipsis_empty_output(arg)
end

this kind of function declaration would trigger this error.

This patch fixes this issue and changes the way that the multivariable assignment is parsed to remove the spurious ignored variable token when the lhs is empty.

@apozharski apozharski changed the title Allow for line continuations between multivariable assignment block and equal sign. Various bugfixes in the grammar Aug 14, 2024
@apozharski
Copy link
Contributor Author

I have added additional changes to correctly handle trailing semicolons on various blocks. it may make sense to do this in a more elegant way via a shared "end" symbol which has an optional trailing semicolon. I will collate the remaining bugfixes arising from the test suite in sphinxcontrib-matlabdomain in this PR.

@acristoffers
Copy link
Owner

Thank you for your pull request, but I'll have to ask you to split it in two: one with the changes for the multi-output assignment of the original PR and another with the other changes pertaining the semicolons. The PR for the multi-output assignment is going to be accepted almost immediately, but the other one I want to test and take a better look at the changes to make sure there is no regression, since it will touch quite a few rules. And sorry for taking so long to answer, I was rather busy this week :(

@apozharski
Copy link
Contributor Author

apozharski commented Aug 15, 2024

Yep, that is no problem, frankly they were only lumped together because of laziness. Closing this and will open separate PRs.

@apozharski apozharski closed this Aug 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants