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 crashes when setting -c3 to format commments and comment has no characters #29

Open
dalybrown opened this issue Oct 5, 2023 · 0 comments

Comments

@dalybrown
Copy link

I'm trying to pretty print some generated code from a tool I don't have control over. It generates comments using only a single space between the delimiter and the start of the comment. The style enforced by alire and gnat require two spaces. This seems like a good job for the pretty printer. However, it crashes immediately, even for the most basic example.

Here is a file (test.ads):

--
-- Test
--
package Test is end;

If I run the pretty printer on it using the following command:

gnatpp -c3 test.ads

It just raises an exception and quits:

Unhandled Exception raised
raised ADA.ASSERTIONS.ASSERTION_ERROR : pp-formatting.adb:310

If you don't have the extra delimiters, it works fine:

-- Test

package Test is end;

I'm using version 23.0.0 of the tool: https://github.com/alire-project/alire-index/blob/stable-1.2.1/index/li/libadalang_tools/libadalang_tools-23.0.0.toml.

It should handle the case where comments are surrounded by delimiters (unless it does and I'm missing a setting).

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

1 participant