This is the first public release of ada_caser
in Alire. It is a tool to adjust the casing in an Ada source code to a “normal” form. The normal casing form in Ada source has keywords in lower case, identifiers in title case (Title_Case
).
If a project file is supplied, ada_caser
reads the project file, and the tree of referenced projects. It then uses Libadalang to find the declaration (if any) of each identifier in the input source code and replaces the source text with that of the declaration.
If no project file is supplied, ada_caser
uses a default project which allows it to access the standard library (Ada*
, GNAT*
, Interfaces*
).
So, for example, ada.text_io.fixed_io
will be replaced by Ada.Text_IO.Fixed_IO
.
For previously-declared identifiers, ada_caser
will convert the identifier to the casing with which it was declared.
The default processing of undeclared identifiers is to convert the first character of each word to upper-case (reserved words are converted to lower-case, other tokens are left unchanged).
This default can be overridden using casing dictionaries.
Suggestions for improvements welcome!