Commit bac0819a by Robert Dewar Committed by Arnaud Charlet

par.adb (Par): Improved msg for attempt to recompile predefined unit

2005-03-17  Robert Dewar  <dewar@adacore.com>

	* par.adb (Par): Improved msg for attempt to recompile predefined unit

From-SVN: r96672
parent 7b8ee2f6
...@@ -1318,9 +1318,9 @@ begin ...@@ -1318,9 +1318,9 @@ begin
end if; end if;
end; end;
-- Here if we are not skipping a file in multiple unit per file -- Here if we are not skipping a file in multiple unit per file
-- mode. Parse the unit that we are interested in. Note that in -- mode. Parse the unit that we are interested in. Note that in
-- check syntax mode we are interested in all units in the file. -- check syntax mode we are interested in all units in the file.
else else
declare declare
...@@ -1355,25 +1355,38 @@ begin ...@@ -1355,25 +1355,38 @@ begin
Name := Uname (Uname'First .. Uname'Last - 2); Name := Uname (Uname'First .. Uname'Last - 2);
if (Name = "ada" or else if Name = "ada" or else
Name = "calendar" or else Name = "calendar" or else
Name = "interfaces" or else Name = "interfaces" or else
Name = "system" or else Name = "system" or else
Name = "machine_code" or else Name = "machine_code" or else
Name = "unchecked_conversion" or else Name = "unchecked_conversion" or else
Name = "unchecked_deallocation" Name = "unchecked_deallocation"
or else (Name'Length > 4 then
and then Error_Msg
Name (Name'First .. Name'First + 3) = ("language defined units may not be recompiled",
"ada.") Sloc (Unit (Comp_Unit_Node)));
or else (Name'Length > 11
and then elsif Name'Length > 4
Name (Name'First .. Name'First + 10) = and then
"interfaces.") Name (Name'First .. Name'First + 3) = "ada."
or else (Name'Length > 7 then
and then Error_Msg
Name (Name'First .. Name'First + 6) = ("descendents of package Ada " &
"system.")) "may not be compiled",
Sloc (Unit (Comp_Unit_Node)));
elsif Name'Length > 11
and then
Name (Name'First .. Name'First + 10) = "interfaces."
then
Error_Msg
("descendents of package Interfaces " &
"may not be compiled",
Sloc (Unit (Comp_Unit_Node)));
elsif Name'Length > 7
and then Name (Name'First .. Name'First + 6) = "system."
and then Name /= "system.rpc" and then Name /= "system.rpc"
and then and then
(Name'Length < 11 (Name'Length < 11
...@@ -1381,7 +1394,8 @@ begin ...@@ -1381,7 +1394,8 @@ begin
"system.rpc.") "system.rpc.")
then then
Error_Msg Error_Msg
("language defined units may not be recompiled", ("descendents of package System " &
"may not be compiled",
Sloc (Unit (Comp_Unit_Node))); Sloc (Unit (Comp_Unit_Node)));
end if; end if;
end; end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment