Natools

Diff
Login

Differences From Artifact [04d3c06d6b]:

To Artifact [d9720a139b]:


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57


58
59
60
61
62
63
64
65
66
   type Quoted_Option is (When_Shorter, Single_Line, No_Quoted);
   type Token_Option is (Extended_Token, Standard_Token, No_Token);
   type Screen_Offset is new Natural;

   subtype Screen_Column is Screen_Offset range 1 .. Screen_Offset'Last;

   type Parameters is record
      Width         : Screen_Offset;
      Newline_At    : Entity_Separator;
      Space_At      : Entity_Separator;
      Tab_Stop      : Screen_Column;
      Indentation   : Screen_Offset;
      Indent        : Indent_Type;
      Quoted        : Quoted_Option;
      Token         : Token_Option;
      Hex_Casing    : Encodings.Hex_Casing;
      Quoted_Escape : Quoted_Escape_Type;
      Char_Encoding : Character_Encoding;
      Fallback      : Atom_Encoding;
      Newline       : Newline_Encoding;
   end record;



   Canonical : constant Parameters;

   type Printer is abstract limited new Printers.Printer with private;

   procedure Write_Raw
     (Output : in out Printer;
      Data : in Ada.Streams.Stream_Element_Array)
     is abstract;







|
|
|
|
|
|
|
|
|
|
|
|
|

>
>

|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
   type Quoted_Option is (When_Shorter, Single_Line, No_Quoted);
   type Token_Option is (Extended_Token, Standard_Token, No_Token);
   type Screen_Offset is new Natural;

   subtype Screen_Column is Screen_Offset range 1 .. Screen_Offset'Last;

   type Parameters is record
      Width         : Screen_Offset        := 0;
      Newline_At    : Entity_Separator     := (others => (others => False));
      Space_At      : Entity_Separator     := (others => (others => False));
      Tab_Stop      : Screen_Column        := 8;                --  *
      Indentation   : Screen_Offset        := 0;
      Indent        : Indent_Type          := Spaces;           --  *
      Quoted        : Quoted_Option        := No_Quoted;
      Token         : Token_Option         := No_Token;
      Hex_Casing    : Encodings.Hex_Casing := Encodings.Upper;  --  *
      Quoted_Escape : Quoted_Escape_Type   := Hex_Escape;       --  *
      Char_Encoding : Character_Encoding   := ASCII;            --  *
      Fallback      : Atom_Encoding        := Verbatim;
      Newline       : Newline_Encoding     := LF;               --  *
   end record;
      --  Default values yield canonical encoding, though fields marked with
      --  an asterisk (*) can have any value and still be canonical.

   Canonical : constant Parameters := (others => <>);

   type Printer is abstract limited new Printers.Printer with private;

   procedure Write_Raw
     (Output : in out Printer;
      Data : in Ada.Streams.Stream_Element_Array)
     is abstract;
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
      Cursor       : Screen_Column := 1;
      Previous     : Entity;
      First        : Boolean := True;
      Indent_Level : Screen_Offset := 0;
      Need_Blank   : Boolean := False;
   end record;

   Canonical : constant Parameters :=
     (Width         => 0,
      Newline_At    => (others => (others => False)),
      Space_At      => (others => (others => False)),
      Tab_Stop      => 8,  --  unused
      Indentation   => 0,
      Indent        => Spaces,  --  unused
      Quoted        => No_Quoted,
      Token         => No_Token,
      Hex_Casing    => Encodings.Upper,  --  unused
      Quoted_Escape => Octal_Escape,  --  unused
      Char_Encoding => ASCII,  --  unused
      Fallback      => Verbatim,
      Newline       => LF);  --  unused

   type Stream_Printer (Stream : access Ada.Streams.Root_Stream_Type'Class) is
     new Printer with null record;

   overriding procedure Write_Raw
     (Output : in out Stream_Printer;
      Data : in Ada.Streams.Stream_Element_Array);

end Natools.S_Expressions.Printers.Pretty;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








127
128
129
130
131
132
133















134
135
136
137
138
139
140
141
      Cursor       : Screen_Column := 1;
      Previous     : Entity;
      First        : Boolean := True;
      Indent_Level : Screen_Offset := 0;
      Need_Blank   : Boolean := False;
   end record;
















   type Stream_Printer (Stream : access Ada.Streams.Root_Stream_Type'Class) is
     new Printer with null record;

   overriding procedure Write_Raw
     (Output : in out Stream_Printer;
      Data : in Ada.Streams.Stream_Element_Array);

end Natools.S_Expressions.Printers.Pretty;