Skip to content

Commit 5031898

Browse files
author
Gail Schenker
committed
Merge branch 'po/ada2022' into 'master'
Revert all Ada 2022 changes. See merge request eng/toolchain/templates-parser!7
2 parents 8289bd3 + d5a41cf commit 5031898

15 files changed

+501
-477
lines changed

src/templates_parser-cached_files.adb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ package body Cached_Files is
6363
procedure Add
6464
(Filename : String;
6565
T : Tree;
66-
Old : out Tree)
66+
Old : out Tree)
6767
is
6868
L_Filename : constant Unbounded_String := To_Unbounded_String (Filename);
6969

@@ -128,7 +128,7 @@ package body Cached_Files is
128128
-- Tree is used, mark it as obsoleted, it will be removed
129129
-- when no more used by the Release call.
130130
Old.Obsolete := True;
131-
Old.Used := @ + 1;
131+
Old.Used := Old.Used + 1;
132132

133133
-- But current tree is not used, it has been posted here
134134
-- for futur use. But if replaced right away it should be
@@ -152,7 +152,7 @@ package body Cached_Files is
152152

153153
Files (S + 1 .. Index + 1) := Files (S .. Index);
154154

155-
Index := @ + 1;
155+
Index := Index + 1;
156156

157157
Files (S) := T;
158158

@@ -255,7 +255,6 @@ package body Cached_Files is
255255
pragma Assert (T.Info.Next /= T.C_Info);
256256
Release (T.C_Info, Include => False);
257257
end if;
258-
259258
Templates_Parser_Tasking.Unlock;
260259
exception
261260
when others =>
@@ -320,7 +319,6 @@ package body Cached_Files is
320319
if not Result then
321320
return False;
322321
end if;
323-
324322
P := P.Next;
325323
end loop;
326324

src/templates_parser-data.adb

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Templates Parser --
33
-- --
4-
-- Copyright (C) 1999-2024, AdaCore --
4+
-- Copyright (C) 1999-2019, 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 --
@@ -27,6 +27,8 @@
2727
-- covered by the GNU Public License. --
2828
------------------------------------------------------------------------------
2929

30+
pragma Ada_2012;
31+
3032
with Ada.Text_IO;
3133

3234
separate (Templates_Parser)
@@ -189,13 +191,12 @@ package body Data is
189191
if Pos > Str'First and then Str (Pos - 1) /= '\' then
190192
-- This is not a quoted character
191193
if Str (Pos) = ')' then
192-
Count := @ - 1;
194+
Count := Count - 1;
193195
elsif Str (Pos) = '(' then
194-
Count := @ + 1;
196+
Count := Count + 1;
195197
end if;
196198
end if;
197-
198-
Pos := @ - 1;
199+
Pos := Pos - 1;
199200
end loop;
200201

201202
if Pos = Str'First then
@@ -273,14 +274,14 @@ package body Data is
273274
loop
274275
exit when K > Str'Last;
275276

276-
I := @ + 1;
277+
I := I + 1;
277278

278279
if Str (K) = '\'
279280
and then K < Str'Last
280281
and then not (Str (K + 1) in '0' .. '9')
281282
then
282283
-- An escaped character, skip the backslash
283-
K := @ + 1;
284+
K := K + 1;
284285

285286
-- Handle some special escaped characters \n \r \t
286287

@@ -295,7 +296,7 @@ package body Data is
295296
S (I) := Str (K);
296297
end if;
297298

298-
K := @ + 1;
299+
K := K + 1;
299300
end loop;
300301

301302
return S (S'First .. I);
@@ -444,9 +445,9 @@ package body Data is
444445
raise Template_Error with "NO_DYNAMIC must be the first filter";
445446
end if;
446447

447-
K := @ + 1;
448+
K := K + 1;
448449

449-
Stop := @ - 1;
450+
Stop := Stop - 1;
450451
end loop;
451452

452453
return new Filter.Set'(FS (FS'First .. K - 1));
@@ -473,7 +474,6 @@ package body Data is
473474
-- ??? check for string literal
474475
exit when Tag (Stop + 1) = '(' or else Stop = Tag'First;
475476
end loop;
476-
477477
MP_Start := Stop + 1;
478478
end if;
479479

@@ -647,11 +647,11 @@ package body Data is
647647

648648
for K in R.Parameters'Range loop
649649
if R.Parameters (K) /= null then
650-
R.Parameters (K) := Data.Clone (@);
650+
R.Parameters (K) := Data.Clone (R.Parameters (K));
651651
end if;
652652
end loop;
653653

654-
R.Def := Clone (@);
654+
R.Def := Clone (R.Def);
655655
end if;
656656

657657
return R;
@@ -666,16 +666,15 @@ package body Data is
666666

667667
loop
668668
if N.Kind = Data.Var then
669-
N.Var := Data.Clone (@);
669+
N.Var := Data.Clone (N.Var);
670670
end if;
671671

672672
exit when N.Next = null;
673673

674-
N.Next := new Node'(@.all);
674+
N.Next := new Node'(N.Next.all);
675675
N := N.Next;
676676
end loop;
677677
end if;
678-
679678
return Root;
680679
end Clone;
681680

@@ -871,7 +870,6 @@ package body Data is
871870
else
872871
Text_IO.Put (Value);
873872
end if;
874-
875873
if Value'Length > 0 then
876874
NL := Value (Value'Last) = ASCII.LF;
877875
else
@@ -929,7 +927,7 @@ package body Data is
929927
begin
930928
while T /= null loop
931929
P := T;
932-
T := @.Next;
930+
T := T.Next;
933931

934932
case P.Kind is
935933
when Var => Release (P.Var);
@@ -955,7 +953,6 @@ package body Data is
955953
for K in P'Range loop
956954
P (K) := Data.Parse (To_String (Parameters (K)), 0);
957955
end loop;
958-
959956
return P;
960957
end To_Data_Parameters;
961958

src/templates_parser-debug.adb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ package body Templates_Parser.Debug is
6565
else
6666
Print (N.VS.all, K + 1);
6767
end if;
68-
6968
N := N.Next;
7069
end loop;
7170

src/templates_parser-expr.adb

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Templates Parser --
33
-- --
4-
-- Copyright (C) 1999-2024, AdaCore --
4+
-- Copyright (C) 1999-2019, 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 --
@@ -27,6 +27,8 @@
2727
-- covered by the GNU Public License. --
2828
------------------------------------------------------------------------------
2929

30+
pragma Ada_2012;
31+
3032
with Ada.Text_IO;
3133

3234
separate (Templates_Parser)
@@ -310,7 +312,7 @@ package body Expr is
310312
end F_Xor;
311313

312314
Op_Table : constant array (Expr.Ops) of Ops_Fct :=
313-
[Expr.O_And => F_And'Access,
315+
(Expr.O_And => F_And'Access,
314316
Expr.O_Or => F_Or'Access,
315317
Expr.O_Xor => F_Xor'Access,
316318
Expr.O_Sup => F_Sup'Access,
@@ -320,10 +322,10 @@ package body Expr is
320322
Expr.O_Equal => F_Equ'Access,
321323
Expr.O_Diff => F_Diff'Access,
322324
Expr.O_In => F_In'Access,
323-
Expr.O_Cat => F_Cat'Access];
325+
Expr.O_Cat => F_Cat'Access);
324326

325327
U_Op_Table : constant array (Expr.U_Ops) of U_Ops_Fct :=
326-
[Expr.O_Not => F_Not'Access];
328+
(Expr.O_Not => F_Not'Access);
327329

328330
begin
329331
case E.Kind is
@@ -509,28 +511,28 @@ package body Expr is
509511
-- Check symbolic operators
510512
elsif Expression (Index) = '(' then
511513
Current_Token := (Kind => Open_Par);
512-
Index := @ + 1;
514+
Index := Index + 1;
513515

514516
elsif Expression (Index) = ')' then
515517
Current_Token := (Kind => Close_Par);
516-
Index := @ + 1;
518+
Index := Index + 1;
517519

518520
elsif Expression (Index) = '=' then
519521
Current_Token := (Kind => Binary_Op, Bin_Op => O_Equal);
520-
Index := @ + 1;
522+
Index := Index + 1;
521523

522524
elsif Expression (Index) = '/'
523525
and then Index < Expression'Last
524526
and then Expression (Index + 1) = '='
525527
then
526528
Current_Token := (Kind => Binary_Op, Bin_Op => O_Diff);
527-
Index := @ + 2;
529+
Index := Index + 2;
528530

529531
elsif Expression (Index) = '<' then
530532
Index := Index + 1;
531533
if Expression (Index) = '=' then
532534
Current_Token := (Kind => Binary_Op, Bin_Op => O_Einf);
533-
Index := @ + 1;
535+
Index := Index + 1;
534536
else
535537
Current_Token := (Kind => Binary_Op, Bin_Op => O_Inf);
536538
end if;
@@ -539,15 +541,15 @@ package body Expr is
539541
Index := Index + 1;
540542
if Expression (Index) = '=' then
541543
Current_Token := (Kind => Binary_Op, Bin_Op => O_Esup);
542-
Index := @ + 1;
544+
Index := Index + 1;
543545
else
544546
Current_Token := (Kind => Binary_Op, Bin_Op => O_Sup);
545547
end if;
546548

547549
elsif Expression (Index) = '"' then
548550
-- This is a string, return it
549-
Current_Token :=
550-
(Kind => Value, Start => Index + 1, Stop => Index);
551+
Current_Token
552+
:= (Kind => Value, Start => Index + 1, Stop => Index);
551553

552554
loop
553555
if Current_Token.Stop = Expression'Last then
@@ -558,7 +560,6 @@ package body Expr is
558560
Current_Token.Stop := Current_Token.Stop + 1;
559561
end if;
560562
end loop;
561-
562563
Index := Current_Token.Stop + 2;
563564

564565
else
@@ -583,7 +584,7 @@ package body Expr is
583584
exit when Expression (Index) /= '/'
584585
or else Expression (Index + 1) = '=';
585586

586-
Index := @ + 1;
587+
Index := Index + 1;
587588
end loop;
588589

589590
declare
@@ -633,13 +634,13 @@ package body Expr is
633634
Error ("variable end not found");
634635

635636
else
636-
Current_Token :=
637-
(Kind => Var, Start => I, Stop => Index - 1);
637+
Current_Token
638+
:= (Kind => Var, Start => I, Stop => Index - 1);
638639
end if;
639640

640641
else
641-
Current_Token :=
642-
(Kind => Value, Start => I, Stop => Index - 1);
642+
Current_Token
643+
:= (Kind => Value, Start => I, Stop => Index - 1);
643644
end if;
644645
end;
645646
end if;
@@ -684,7 +685,6 @@ package body Expr is
684685
end case;
685686

686687
Next_Token;
687-
688688
if Current_Token.Kind = Binary_Op
689689
and then Current_Token.Bin_Op = O_Cat
690690
then
@@ -704,7 +704,6 @@ package body Expr is
704704
when Open_Par =>
705705
Next_Token;
706706
Result := Expr;
707-
708707
if Current_Token.Kind = Close_Par then
709708
Next_Token;
710709
return Result;

0 commit comments

Comments
 (0)