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

Matlab class syntax improvement #75

Closed

Conversation

oswald3141
Copy link
Contributor

@zufuliu suggested adding support for the classes definition syntax in the discussion of PR #70. This PR contains a proposed solution.
It works fine with the correct syntax but employs a little hack: it doesn't recognize function scopes to avoid storing too much data in the line state integer. Instead, it just considers everything within a folding level beyond the 2nd to be a function's scope. This consideration may lead to the erroneous neglect of some keywords (there's an example in the proposed test). However, such a problem can occur only in a file with invalid syntax, so I think it's not really an issue.

Add handling of the following contextual keywords, used in classes'
declarations: properties, methods, events.
@nyamatongwe nyamatongwe added the matlab Caused by the matlab or octave lexer label Apr 20, 2022
nyamatongwe pushed a commit that referenced this pull request Apr 22, 2022
Add handling of the following contextual keywords, used in classes'
declarations: properties, methods, events.
@nyamatongwe
Copy link
Member

Committed as 17c58fd with addition to change log and mention of pull number in commit message.

@oswald3141
Copy link
Contributor Author

Thank you!

@nyamatongwe
Copy link
Member

Included in 5.1.7 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
matlab Caused by the matlab or octave lexer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants