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

Invalid error for keyword arguments #290

Open
pvogt09 opened this issue Apr 24, 2024 · 3 comments
Open

Invalid error for keyword arguments #290

pvogt09 opened this issue Apr 24, 2024 · 3 comments
Labels
bug: minor Something isn't working component: parser Affects the parser difficulty: high This change will be tricky or large

Comments

@pvogt09
Copy link

pvogt09 commented Apr 24, 2024

MISS_HIT Component affected
Please choose one from:

  • Style checker

Your MATLAB/Octave environment

  • MATLAB
  • R2023B

Your operating system and Python version

  • Linux
  • python 3.8.10

Describe the bug
The file

 function [] = test()
    a = 0;
    arguments = struct(...
        'test', 1.0...
    );
end

gives the error

In arguments.m, line 3
|     arguments = struct(...
|     ^^^^^^^^^ error: expected valid statement, found keyword 'arguments' instead
MISS_HIT Style Summary: 1 file(s) analysed, 1 error(s)

which should not be the case because it is allowed to have variables called arguments as long as the keyword does not appear as the first expression in the function body (a = 0; makes the difference here between invalid Matlab syntax and correct code).

@florianschanda
Copy link
Owner

This one is going to be annoying to fix. I am looking into it.

@florianschanda florianschanda added bug: minor Something isn't working component: parser Affects the parser labels Jul 8, 2024
@florianschanda florianschanda added the difficulty: high This change will be tricky or large label Aug 15, 2024
@florianschanda
Copy link
Owner

I looked into it. This one will be horrible to fix. How important is this one to you?

florianschanda added a commit that referenced this issue Aug 15, 2024
@pvogt09
Copy link
Author

pvogt09 commented Aug 22, 2024

Since there is a workaround and it can be prevented by simply using a different variable name, the priority is not too high. If you want to prioritize something, it would be #287, because there does not seem to be a workaround and it is currently blocking me from using miss_hit as commit hook because there are many uses of class attributes that do not comply the naming schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: minor Something isn't working component: parser Affects the parser difficulty: high This change will be tricky or large
Projects
None yet
Development

No branches or pull requests

2 participants