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

gnatpp: Missing space when character is combined with a unicode "Nonspacing Mark" #35

Open
ThyMYthOS opened this issue Sep 9, 2024 · 2 comments

Comments

@ThyMYthOS
Copy link

Nonspacing marks: https://www.compart.com/en/unicode/category/Mn

Actual (gnatpp 24.0.0):

package Test is
   A  : Integer;
   Ω0 : Float;
   Ω̇ : Float;
end Test;

Expected:

package Test is
   A  : Integer;
   Ω0 : Float;
   Ω̇  : Float;
end Test;
@joaopsazevedo
Copy link
Collaborator

Hello @ThyMYthOS.

AdaCore now provides a new formatter GNATformat, currently in beta. This will supersede GNATpp when leaving the beta program.

Beta mostly means that the formatting style will have some changes during the next year, until a consensus is reach. Feel free to give it a try and provide feedback, both bug reports and style issues.

Currently, the biggest known issue is on comments in some specific location, such as inside binary operations. For example:

A.B
--  Comment
and C

Other than that, it is expected to work correctly.

Due to our current efforts being mostly on GNATformat, it's unlikely that the reported issue will be fixed in gnatpp.

GNATformat handles your example corretly though:

$ gnatformat --charset utf-8 --pipe test.ads
package Test is
   A  : Integer;
   Ω0 : Float;
   Ω̇  : Float;
end Test;

Note that currently --charset utf-8 is needed, but, if you have a GPR project file, we plan to infer the character encoding from it in the near future.

@ThyMYthOS
Copy link
Author

@joaopsazevedo thanks for your hint. Will gnatformat be available on alire (soon)?

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

2 participants