Skip to content

Commit 07968b8

Browse files
committed
Merge branch 'topic/instance_exemptions' into 'master'
Resolve regressions related to exemptions handling in GNATcheck See merge request eng/libadalang/langkit-query-language!294
2 parents be190a9 + 0f3f15b commit 07968b8

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

lkql_checker/src/gnatcheck-diagnoses.adb

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,24 +1089,18 @@ package body Gnatcheck.Diagnoses is
10891089
function Get_Exemption_Kind
10901090
(Image : Wide_Wide_String) return Exemption_Kinds
10911091
is
1092-
Result : Exemption_Kinds;
1092+
Norm_Image : constant Wide_Wide_String := To_Lower
1093+
(if Image (Image'First) = '"'
1094+
then Image (Image'First + 1 .. Image'Last - 1)
1095+
else Image);
10931096
begin
1094-
if Image (Image'First) = '"' then
1095-
1096-
-- Old format of Annotate pragma. We have to cut out quotation marks
1097-
1098-
Result :=
1099-
Exemption_Kinds'Wide_Wide_Value
1100-
(Image (Image'First + 1 .. Image'Last - 1));
1097+
if Norm_Image = "exempt_on" then
1098+
return Exempt_On;
1099+
elsif Norm_Image = "exempt_off" then
1100+
return Exempt_Off;
11011101
else
1102-
Result := Exemption_Kinds'Wide_Wide_Value (Image);
1103-
end if;
1104-
1105-
return Result;
1106-
1107-
exception
1108-
when Constraint_Error =>
11091102
return Not_An_Exemption;
1103+
end if;
11101104
end Get_Exemption_Kind;
11111105

11121106
-----------------------------

0 commit comments

Comments
 (0)