Skip to content

Multiple return arguments written as array results in parse error #299

@pvogt09

Description

@pvogt09

MISS_HIT Component affected

  • 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 [arg8] = test(in1, in2)
    [
        arg1, ...
        arg2, ...
        arg3, ...
        arg4, ...
        arg5, ...
        arg6, ...
        arg7, ...
        arg8...
    ] = function_many_outputs(in1, in2);
end

gives the following error:

In output_argument_list.m, line 2
|     [
|      ^^^ error: expected IDENTIFIER, found NEWLINE instead

This should not be the case because Matlab accepts this syntax as valid which is also in concordance with the way arrays can be specified. The error vanishes when using [... instead of only [.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions