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: Pretty Printer formater incorrectly idents commenting blocks #3

Open
NCommander opened this issue Jul 24, 2019 · 1 comment

Comments

@NCommander
Copy link

I was forwarded here by @pmderodat relating to an issue I ran into with GNAT GPL Community 2019 relating to pretty printing. I haven't been able to simply the test case but the full source code is available here: https://github.com/dnscatcher/DNSCatcher

The issue is consistent in many of the files in src/dnscatcher/dns/processor/rdata/*.ads, and manifests like this

   -- Converts a RR record to logicial representation
   --
   -- @value This
   -- Class object
   --
   -- @value DNS_Header
   -- DNS Packet Header
   --
   -- @value Parsed_RR
   -- Any parsed Resource Record from Processor.Packet
   --
   procedure From_Parsed_RR
     (This       : in out Parsed_Unknown_RData;
      DNS_Header :        DNS_Packet_Header;
      Parsed_RR  :        Parsed_DNS_Resource_Record);

      -- Represents RData as a String for debug logging
      --
      -- @value This
      -- Class object
      --
      -- @returns
      -- String saying "UNKNOWN"
      --
   function RData_To_String
     (This : in Parsed_Unknown_RData)
      return String;

   -- Represents the resource record packet as a whole as a string
   --
   -- @value This
   -- Class object
   --
   -- @returns
   --  String that states "UNKNOWN"
   --
   function Print_Packet
     (This : in Parsed_Unknown_RData)
      return String;

That single block keeps being indented in all the subclasses of RData in this package. The pretty printer settings are as follows (from compiler_settings.gpr)

   package Pretty_Printer is
      for Default_Switches ("ada") use (
                                        "-w",
                                        "-rnb",
                                        "-c4",
                                        "--call_threshold=1",
                                        "--par_threshold=1",
                                        "--separate-stmt-name",
                                        "--vertical-enum-types",
                                        "--vertical-array-types",
                                        "--vertical-case-alternatives",
                                        "--separate-loop-then");
   end Pretty_Printer;

I've tried a few other settings with no avail, so any insight or workarounds would be greatly appreciated.

@Fabien-Chouteau
Copy link
Member

Sorry this was closed by mistake.

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