+2014-01-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_Quantified_Expression): If after
+ pre-analysis the loop parameter specification has been
+ rewritten as a iterator specification, propagate the change to
+ the quantified expression, for ASIS navigtion needs.
+
+2014-01-20 Vincent Celier <celier@adacore.com>
+
+ * par-ch10.adb: Minor error message change: escape [ and ].
+
2014-01-20 Robert Dewar <dewar@adacore.com>
* checks.adb: Make warnings on exceptions into errors in GNATprove mode.
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2013, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
(File_Name (Current_Source_File)) = Expect_Body
then
Error_Msg_BC -- CODEFIX
- ("keyword BODY expected here [see file name]");
+ ("keyword BODY expected here '[see file name']");
Restore_Scan_State (Scan_State);
Set_Unit (Comp_Unit_Node, P_Package (Pf_Pbod_Pexp));
else
end if;
else pragma Assert (Present (Loop_Parameter_Specification (N)));
- Preanalyze (Loop_Parameter_Specification (N));
+ declare
+ Loop_Par : constant Node_Id := Loop_Parameter_Specification (N);
+
+ begin
+ Preanalyze (Loop_Par);
+
+ if Nkind (Discrete_Subtype_Definition (Loop_Par)) =
+ N_Function_Call
+ and then Parent (Loop_Par) /= N
+ then
+ -- The parser cannot distinguish between a loop specification
+ -- and an iterator specification. If after pre-analysis the
+ -- proper form has been recognized, rewrite the expression to
+ -- reflect the right kind. The analysis of the loop has been
+ -- performed on a copy that has the proper iterator form. This
+ -- is needed in particular for ASIS navigation.
+
+ Set_Loop_Parameter_Specification (N, Empty);
+ Set_Iterator_Specification (N,
+ New_Copy_Tree (Iterator_Specification (Parent (Loop_Par))));
+ end if;
+ end;
end if;
Preanalyze_And_Resolve (Cond, Standard_Boolean);