Skip to content

Comments

[DRAFT] alternate API to the formatter#199

Open
QuentinOchem wants to merge 3 commits intomasterfrom
to_string2
Open

[DRAFT] alternate API to the formatter#199
QuentinOchem wants to merge 3 commits intomasterfrom
to_string2

Conversation

@QuentinOchem
Copy link
Contributor

No description provided.

@denismazzucato
Copy link

Just a thought, why not to have also something like "Open_Flat_Record" or "Open_Unnested_Record" that would not format the beginning and end of a record, so to avoid having unreadable records from deep record hierarchies (I think Steven mentioned this problem at some point). In that case the first step is called via Open_Record but then proceeds via the flattened one recursively for the parents.

Copy link
Contributor

@swbaird swbaird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor cleanup issues, although the problem with a procedures illegally being primitives of two different tagged types (Formatter and Formatter_Parameters) might require adding a nested package or some similar minor reorganization.

I wrote these comments with the Ada Compatibility Mode version in mind, although some of them may also apply to the Flare version.

Modular_Type,
Float_Type,
Decimal_Type,
Ordinary_Type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordinary_Fixed_Point_Type (with a comma).
And four uses below (in subtype ranges).
Alternatively, just list how this package spec differs from the Flare version.

Protected_Type,
Task_Type);

type Elementary_Type is Ada_Type range Access_Type .. Ordinary_Type;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is intended here (and in the next 6 declarations)? Subtype declarations (so "type" should be "subtype") or derived type declarations (so the word "new" is missing)? I'm guessing subtypes. Either way, some fix is needed.


function Create
(Self : in out Root_Formatter_Parameters;
Format : String) return Root_Formatter_Parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

";" needed
function must be abstract because result type is abstract

Buffer : in out Root_Buffer_Type;
Type_Name : UTF_Encoding.UTF_8_String;
Item : System.Address;
Format : Root_Formatter_Parameters;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra ";"
Ditto for the next 25 subprograms.

a subprogram cannot be a primitive operation of two tagged types (Root_Formatter_Type and Root_Formatter_Parameters).
Ditto for the next 25 subprograms.

procedure Close (
Self : in out Root_Buffer_Type;
Self : in out Root_Formatter_Type;
Buffer : in out Root_Buffer_Type;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra ";"

Self : in out Root_Formatter_Type;
Buffer : in out Root_Buffer_Type;
);
end Root_Formatter_Type with private;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like incomplete editing after copying the Flare version. Perhaps replace this line and the next 3 with
type Default_Formatter_Type is new Root_Formatter_Type with private;
?

-- Implementation-Defined
end Default_Formatter_Type;

Default_Formatter : Default_Formatter_Type;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing "constant" (declaration is illegal without it)

Buffer : in out Root_Buffer_Type;
Type_Name : UTF_Encoding.UTF_8_String;
Format : Root_Formatter_Parameters;
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this (and the following dozen or so procedures) be abstract?

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

Successfully merging this pull request may close these issues.

3 participants