aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2005-01-03 16:40:30 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-01-03 16:40:30 +0100
commit01af9aff566add69b4bd9a5fd0eb2489ba6b19dd (patch)
tree16afa3adf1e3ad99129f628671d8b21107a27e8a /gcc/ada
parent0fe6afd3cf67ef63300d079b9c03dce9ab6ee091 (diff)
downloadgcc-01af9aff566add69b4bd9a5fd0eb2489ba6b19dd.zip
gcc-01af9aff566add69b4bd9a5fd0eb2489ba6b19dd.tar.gz
gcc-01af9aff566add69b4bd9a5fd0eb2489ba6b19dd.tar.bz2
par.adb: Enhance error message handling for configuration file pragmas.
* par.adb: Enhance error message handling for configuration file pragmas. From-SVN: r92846
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/par.adb34
1 files changed, 21 insertions, 13 deletions
diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb
index 8977706..6c8ec70 100644
--- a/gcc/ada/par.adb
+++ b/gcc/ada/par.adb
@@ -1208,7 +1208,6 @@ begin
if Configuration_Pragmas then
declare
- Ecount : constant Int := Serious_Errors_Detected;
Pragmas : constant List_Id := Empty_List;
P_Node : Node_Id;
@@ -1224,20 +1223,29 @@ begin
else
P_Node := P_Pragma;
- if Serious_Errors_Detected > Ecount then
- return Error_List;
- end if;
+ if Nkind (P_Node) = N_Pragma then
+
+ -- Give error if bad pragma
+
+ if Chars (P_Node) > Last_Configuration_Pragma_Name
+ and then Chars (P_Node) /= Name_Source_Reference
+ then
+ if Is_Pragma_Name (Chars (P_Node)) then
+ Error_Msg_N
+ ("only configuration pragmas allowed " &
+ "in configuration file", P_Node);
+ else
+ Error_Msg_N
+ ("unrecognized pragma in configuration file",
+ P_Node);
+ end if;
- if Chars (P_Node) > Last_Configuration_Pragma_Name
- and then Chars (P_Node) /= Name_Source_Reference
- then
- Error_Msg_SC
- ("only configuration pragmas allowed " &
- "in configuration file");
- return Error_List;
- end if;
+ -- Pragma is OK config pragma, so collect it
- Append (P_Node, Pragmas);
+ else
+ Append (P_Node, Pragmas);
+ end if;
+ end if;
end if;
end loop;
end;