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

Non-beautiful space in front of sizes in arguments block #113

Open
FlorianPfaff opened this issue Oct 30, 2021 · 3 comments
Open

Non-beautiful space in front of sizes in arguments block #113

FlorianPfaff opened this issue Oct 30, 2021 · 3 comments

Comments

@FlorianPfaff
Copy link

Hi,
thanks for keeping up the good work on this useful tool! One concerning the arguments block: The code

arguments
    varname (2, 2) double
end

is changed into

arguments
    varname(2, 2) double
end

which is not "beautiful" if you ask me. I know where this comes from - the numbers are interpreted as indices. However, in this context, they are a description of the expected size of the matrix. I think keeping the space there would make the code more beautiful.

Thanks for considering,

Florian

@anakinsleftleg
Copy link

there is no way to for MBeautify to know that that space should be retained. varname isn't a keyword so it just thinks the indices next to it need to be right next to varname. I can't imagine a way for MBeautify to fix that, unless there was some extra logic to read a function's input arguments, and if there is an arguments block, then treat the variable names differently as desired.

@FlorianPfaff
Copy link
Author

FlorianPfaff commented Oct 10, 2022

I acknowledge that this is work and am not saying anyone should do it - however, I do not think there would need to be an extra logic to parse input arguments. It should be enough to detect if one is in an arguments block and then look for lines starting with
\n\t* *([A-Za-z_0-9]* *\([0-9]* *,[0-9]* *)\) *
and ignore them (or turn multiple spaces into a single space to beautify it).

@tulimid1
Copy link

FYI - This also happens in properties blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants