Skip to content

Function Definition Indent Bug #20

Description

@reganwillis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions