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

&&... makes check throw an error #9

Closed
stdout-se opened this issue Oct 1, 2019 · 5 comments · May be fixed by #12 or #13
Closed

&&... makes check throw an error #9

stdout-se opened this issue Oct 1, 2019 · 5 comments · May be fixed by #12 or #13

Comments

@stdout-se
Copy link
Contributor

stdout-se commented Oct 1, 2019

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 ...
@bastibe
Copy link
Owner

bastibe commented Oct 1, 2019

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.

@stdout-se
Copy link
Contributor Author

Starting work on this issue

@ChristianStadelmann
Copy link

Same for ||....

@ChristianStadelmann
Copy link

I've implemented a fix in #12.

ChristianStadelmann pushed a commit to ChristianStadelmann/MatlabCodeAnalyzer that referenced this issue Jan 19, 2021
Prior to this change, any line ending with `[punctuation + '...']`, for
example `||...`, would cause the tokenizer to fail.

Fixes bastibe#9
slootsjj added a commit that referenced this issue Feb 2, 2024
Fix &&... to not throw an error
Update TokenizeTests to include all testcases
@slootsjj
Copy link
Collaborator

slootsjj commented Feb 2, 2024

Pull request #16 fixes this issue

@slootsjj slootsjj closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants