Skip to content

Improve arguments blocks handling (Matlab)#179

Closed
oswald3141 wants to merge 3 commits intoScintillaOrg:masterfrom
oswald3141:matlab_arguments_130623
Closed

Improve arguments blocks handling (Matlab)#179
oswald3141 wants to merge 3 commits intoScintillaOrg:masterfrom
oswald3141:matlab_arguments_130623

Conversation

@oswald3141
Copy link
Copy Markdown
Contributor

arguments is context-dependent in Matlab: sometimes it's a valid identifier, and sometimes it's a keyword. This PR:

  • adds support for multiple sequential arguments blocks;
  • prevents a function argument named "arguments" from being treated as a keyword;
  • fixes a bug in handling arguments blocks in one line functions (the syntax is probably not used in the real world);
  • fixes a bug due to which a semicolon before an arguments block could break folding.

The corresponding tests are included.

"arguments" is a valid function argument name. It should not be
recognized as a keyword in a function declaration line.
Matlab allows multiple sequential arguments blocks
imposing restrictions on different kinds of arguments.
A semicolon must behave the same as a comment between a function
declaration line and and an arguments block beginning.
A semicolon must end a function declaration even if there's no
following line break.
@nyamatongwe nyamatongwe added the matlab Caused by the matlab or octave lexer label Jun 26, 2023
@nyamatongwe nyamatongwe changed the title Imrove arguments blocks handling (Matlab) Improve arguments blocks handling (Matlab) Jun 26, 2023
nyamatongwe pushed a commit that referenced this pull request Jun 27, 2023
"arguments" is a valid function argument name. It should not be
recognized as a keyword in a function declaration line.
nyamatongwe pushed a commit that referenced this pull request Jun 27, 2023
Matlab allows multiple sequential arguments blocks
imposing restrictions on different kinds of arguments.
nyamatongwe pushed a commit that referenced this pull request Jun 27, 2023
A semicolon must behave the same as a comment between a function
declaration line and and an arguments block beginning.
A semicolon must end a function declaration even if there's no
following line break.
@nyamatongwe nyamatongwe added the committed Issue fixed in repository but not in release label Jun 27, 2023
@nyamatongwe
Copy link
Copy Markdown
Member

Committed with additions to history file.

@oswald3141
Copy link
Copy Markdown
Contributor Author

Thank you!

@nyamatongwe nyamatongwe removed the committed Issue fixed in repository but not in release label Feb 28, 2026
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