aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-01-20 17:02:58 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-20 17:02:58 +0100
commita736f6e612f3c25b8510cce5269515ce7d9a0a78 (patch)
tree54c2cb5b9e8266023aa4f88e23825009d4dab742 /gcc
parent4a28b181a6164561a56bf02dfa1fd568e3d0ec5b (diff)
downloadgcc-a736f6e612f3c25b8510cce5269515ce7d9a0a78.zip
gcc-a736f6e612f3c25b8510cce5269515ce7d9a0a78.tar.gz
gcc-a736f6e612f3c25b8510cce5269515ce7d9a0a78.tar.bz2
[multiple changes]
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 ]. From-SVN: r206842
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/par-ch10.adb4
-rw-r--r--gcc/ada/sem_ch4.adb23
3 files changed, 35 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index fec727a..3d73ee3 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+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.
diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb
index ddd88b3..00b294b 100644
--- a/gcc/ada/par-ch10.adb
+++ b/gcc/ada/par-ch10.adb
@@ -6,7 +6,7 @@
-- --
-- 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- --
@@ -360,7 +360,7 @@ package body Ch10 is
(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
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index a95aea9..fcf6c75 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -3667,7 +3667,28 @@ package body Sem_Ch4 is
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);