Natools

Diff
Login

Differences From Artifact [0ce9683aff]:

To Artifact [3aa2c30191]:


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

   function Current_Atom (P : in Parser) return Atom is
   begin
      if P.Latest /= Events.Add_Atom then
         raise Program_Error;
      end if;

      return P.Buffer.Query;
   end Current_Atom;


   function Current_Level (P : in Parser) return Natural is
   begin
      return P.Level;
   end Current_Level;







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

   function Current_Atom (P : in Parser) return Atom is
   begin
      if P.Latest /= Events.Add_Atom then
         raise Program_Error;
      end if;

      return P.Buffer.Data;
   end Current_Atom;


   function Current_Level (P : in Parser) return Natural is
   begin
      return P.Level;
   end Current_Level;
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
      Data   : out Atom;
      Length : out Count) is
   begin
      if P.Latest /= Events.Add_Atom then
         raise Program_Error;
      end if;

      P.Buffer.Query (Data, Length);
   end Read_Atom;


   procedure Next_Event
     (P     : in out Parser;
      Input : not null access Ada.Streams.Root_Stream_Type'Class)
   is







|







61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
      Data   : out Atom;
      Length : out Count) is
   begin
      if P.Latest /= Events.Add_Atom then
         raise Program_Error;
      end if;

      P.Buffer.Read (Data, Length);
   end Read_Atom;


   procedure Next_Event
     (P     : in out Parser;
      Input : not null access Ada.Streams.Root_Stream_Type'Class)
   is
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
               then
                  P.Buffer.Append
                    (Encodings.Decode_Base64 (P.Internal.Chunk.Data
                                          (0 .. P.Internal.Chunk.Length - 1)));
                  if P.Internal.State = Base64_Atom then
                     P.Latest := Events.Add_Atom;
                  else
                     P.Override.Append (P.Buffer.Query);
                     P.Buffer.Soft_Reset;
                  end if;
                  P.Internal := (State => Waiting);
               end if;

            when Hex_Atom =>
               if Encodings.Is_Hex_Digit (O) then







|







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
               then
                  P.Buffer.Append
                    (Encodings.Decode_Base64 (P.Internal.Chunk.Data
                                          (0 .. P.Internal.Chunk.Length - 1)));
                  if P.Internal.State = Base64_Atom then
                     P.Latest := Events.Add_Atom;
                  else
                     P.Override.Append (P.Buffer.Data);
                     P.Buffer.Soft_Reset;
                  end if;
                  P.Internal := (State => Waiting);
               end if;

            when Hex_Atom =>
               if Encodings.Is_Hex_Digit (O) then