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

Function Definition Indent Bug #20

Open
reganwillis opened this issue Nov 19, 2023 · 1 comment
Open

Function Definition Indent Bug #20

reganwillis opened this issue Nov 19, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@reganwillis
Copy link

Hello, thanks for a very useful language conversion tool. I have identified a bug where the definition of an output function is not indented, resulting in an Indentation Error. I tested the conditional statement indent and it worked as expected. Please see the below test using matlabparser/parser.py:

file.m
% if statement indent test
if true
    disp("if statement")
end

% function test
function ret = add_one(a)
    ret = a + 1;
end
x = add_one(2)
file.py
 # if statement indent test
if True:
    print('if statement')
 
# function test
def add_one(a = None):
ret = a + 1
return ret
x = add_one(2)

I will look more into this issue if it is found to be reproducible.

@ebranlard
Copy link
Owner

Dear @reganwillis
Thank you for posting this and posting a minimal example. I probably won't look at it untill a couple of months, but it sounds like this should be fixable.

@ebranlard ebranlard added bug Something isn't working help wanted Extra attention is needed labels Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants