MatlabCodeAnalyzer icon indicating copy to clipboard operation
MatlabCodeAnalyzer copied to clipboard

&&... makes check throw an error

Open stdout-se opened this issue 6 years ago • 4 comments

Using latest commit from master (fc93e9a) and Matlab 2017b:

check with throw an error when checking lines that ends with compact statements, e.g. &&... or ||....

Steps to reproduce:

  • Create a new file testDots.m and paste the following:
function third = testDots()
    % TESTDOTS tests dots immediately following something else
    first = true;
    second = false;
    
    third = first &&...
        second;
end
  • Run check testDots.m
  • The following output is produced:
>> check testDots.m
Error using tokenize_code (line 123)
unknown operator '&&...'

Error in check (line 47)
    tokens = tokenize_code(source_code);

Expected behaviour:

  • A warning that there should be a space between && and ...

stdout-se avatar Oct 01 '19 12:10 stdout-se

Thank you for your bug report. Would you like to create a pull request that fixes the error? I am currently not able to work on this project and would appreciate the help.

bastibe avatar Oct 01 '19 14:10 bastibe

Starting work on this issue

stdout-se avatar Oct 09 '19 07:10 stdout-se

Same for ||....

ChristianStadelmann avatar Jan 19 '21 16:01 ChristianStadelmann

I've implemented a fix in #12.

ChristianStadelmann avatar Jan 19 '21 17:01 ChristianStadelmann

Pull request #16 fixes this issue

slootsjj avatar Feb 02 '24 15:02 slootsjj