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

Unexpected addition of a space between operator and sign #4266

Open
JEAYNE opened this issue Mar 28, 2024 · 0 comments
Open

Unexpected addition of a space between operator and sign #4266

JEAYNE opened this issue Mar 28, 2024 · 0 comments

Comments

@JEAYNE
Copy link
Contributor

JEAYNE commented Mar 28, 2024

Hi,

I'm using Uncrustify-0.78.1_f (downloaded from Github), with Windows 11.
In the examples below I'm using an empty configuration.

  1. When I submit this kind of code to uncrustify
    a=b<op>c;
    the output is the same as the input.
    This is true for <op> in { + - * / % << >> | & ^ }
    Example Input:
    a=b/c;
    Output:
    a=b/c;

  2. When I submit this kind of code (with <op> != <sign>) to uncrustify
    a=b<op><sign>c;
    the output is
    a=b<op><space><sign>c;
    The addition of this space is true for all combinations where <op> is in { + - * / << >> % | & } and <sign> in { + - } and <op> != <sign>
    EXCEPTION: with operator ^ no space is added between ^ and the sign (input == output )
    Example Input:
    a=b/-c;
    Output:
    a=b/ -c;

Attached a .tar.gz file with the outputs generated by this command
uncrustify -c empty.cfg -f FILE.cpp -L A 2>FILE.log 1>FILE.out
With these 3 input FILEs

  • div.cpp is a=b/-c;
  • and.cpp is a=b&-c;
  • xor.cpp is a=b^-c;

bug-report_20240328.tar.gz

Regards

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

No branches or pull requests

2 participants