Skip to content

Commit 38ccfe2

Browse files
committed
Use Ada 2022 @ short hand syntax.
1 parent d12197c commit 38ccfe2

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

src/templates_parser-utils.adb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Templates Parser --
33
-- --
4-
-- Copyright (C) 2004-2014, AdaCore --
4+
-- Copyright (C) 2004-2024, AdaCore --
55
-- --
66
-- This library is free software; you can redistribute it and/or modify --
77
-- it under terms of the GNU General Public License as published by the --
@@ -249,7 +249,8 @@ package body Templates_Parser.Utils is
249249
else
250250
Append (Result, Image (N.VS.all));
251251
end if;
252-
N := N.Next;
252+
253+
N := @.Next;
253254
end loop;
254255

255256
return "(" & To_String (Result) & ")";

xsrc/templates_parser-xml.adb

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ package body Templates_Parser.XML is
186186

187187
else
188188
L := N - 1; -- Last character for the tag name
189-
N := N + 4; -- First character after _DIM
189+
N := @ + 4; -- First character after _DIM
190190

191191
loop
192-
N := N + 1;
192+
N := @ + 1;
193193
exit when Var (N) = '_' or else N = Var'Last;
194194

195195
if Var (N) not in '0' .. '9' then
@@ -288,8 +288,8 @@ package body Templates_Parser.XML is
288288
Output_Tag (N.VS.all, Pos & Indices'[P]);
289289
end if;
290290

291-
P := P + 1;
292-
N := N.Next;
291+
P := @ + 1;
292+
N := @.Next;
293293
end loop;
294294
end Output_Tag;
295295

@@ -467,7 +467,7 @@ package body Templates_Parser.XML is
467467
N := DOM.Core.Nodes.First_Child (Parent);
468468

469469
while N /= null and then DOM.Core.Nodes.Node_Name (N) = "#text" loop
470-
N := DOM.Core.Nodes.Next_Sibling (N);
470+
N := DOM.Core.Nodes.Next_Sibling (@);
471471
end loop;
472472

473473
return N;
@@ -495,7 +495,7 @@ package body Templates_Parser.XML is
495495
M : DOM.Core.Node := N;
496496
begin
497497
loop
498-
M := DOM.Core.Nodes.Next_Sibling (M);
498+
M := DOM.Core.Nodes.Next_Sibling (@);
499499
exit when M = null or else DOM.Core.Nodes.Node_Name (M) /= "#text";
500500
end loop;
501501

@@ -616,7 +616,7 @@ package body Templates_Parser.XML is
616616
and then Local_Name (Item (Atts, 0)) = "ind"
617617
then
618618
K := Positive'Value (Node_Value (Item (Atts, 0)));
619-
Max := Natural'Max (Max, K);
619+
Max := Natural'Max (@, K);
620620

621621
Map.Insert
622622
(Node_Value (Item (Atts, 0)),
@@ -638,7 +638,8 @@ package body Templates_Parser.XML is
638638
Error (C, "Entity Label expected, found " & N_Name);
639639
end if;
640640
end;
641-
C := Next_Sibling (C);
641+
642+
C := Next_Sibling (@);
642643
end loop;
643644

644645
-- Now we have all labels indexed into the Map (key being the
@@ -712,7 +713,7 @@ package body Templates_Parser.XML is
712713
end if;
713714
end;
714715

715-
C := Next_Sibling (C);
716+
C := Next_Sibling (@);
716717
end loop;
717718

718719
return Result;
@@ -791,7 +792,7 @@ package body Templates_Parser.XML is
791792
end if;
792793
end;
793794

794-
C := Next_Sibling (C);
795+
C := Next_Sibling (@);
795796
end loop;
796797

797798
if not Found then
@@ -887,7 +888,7 @@ package body Templates_Parser.XML is
887888
end if;
888889
end;
889890

890-
C := Next_Sibling (C);
891+
C := Next_Sibling (@);
891892
end loop;
892893

893894
if Name = Null_Unbounded_String then
@@ -925,7 +926,8 @@ package body Templates_Parser.XML is
925926
"Entity Tag, Dim or Entry expected, found " & N_Name);
926927
end if;
927928
end;
928-
C := Next_Sibling (C);
929+
930+
C := Next_Sibling (@);
929931
end loop;
930932

931933
-- Now we have all entities in the Data map
@@ -963,7 +965,8 @@ package body Templates_Parser.XML is
963965
Error (C, "Entity Tag or V expected, found " & N_Name);
964966
end if;
965967
end;
966-
C := Next_Sibling (C);
968+
969+
C := Next_Sibling (@);
967970
end loop;
968971

969972
Insert (Result, Assoc (To_String (Name), To_String (Value)));
@@ -1006,7 +1009,8 @@ package body Templates_Parser.XML is
10061009
"Entity Name or Description expected, found " & N_Name);
10071010
end if;
10081011
end;
1009-
C := Next_Sibling (C);
1012+
1013+
C := Next_Sibling (@);
10101014
end loop;
10111015
end Parse_Tag;
10121016

@@ -1036,7 +1040,7 @@ package body Templates_Parser.XML is
10361040
end if;
10371041
end;
10381042

1039-
C := Next_Sibling (C);
1043+
C := Next_Sibling (@);
10401044
end loop;
10411045

10421046
return T;

0 commit comments

Comments
 (0)