summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-22 10:00:18 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-22 10:00:18 +0000
commit75ef962565fe3f763a5e087399b6dd69fa200ced (patch)
tree012fdf002a8460dafcfb42b7a4799ec65a6268f9 /gcc/ada/par-ch5.adb
parentf37e6e70431d6cb6c018921b3b39814e3a250752 (diff)
downloadgcc-75ef962565fe3f763a5e087399b6dd69fa200ced.tar.gz
2010-10-22 Thomas Quinot <quinot@adacore.com>
* exp_ch5.adb, sem_ch5.adb, sinfo.ads, snames.ads-tmpl, par-ch5.adb: Minor reformatting. 2010-10-22 Geert Bosch <bosch@adacore.com> * stand.ads: Fix typo in comment. 2010-10-22 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb: Enable in-out parameter for functions. 2010-10-22 Ed Schonberg <schonberg@adacore.com> * sem_ch4.adb (Analyze_Quantified_Expression): Handle properly loop iterators that are transformed into container iterators after analysis. * exp_ch4.adb (Expand_N_Quantified_Expression): Handle properly both iterator forms before rewriting as a loop. 2010-10-22 Brett Porter <porter@adacore.com> * a-locale.adb, a-locale.ads, locales.c: New files. * Makefile.rtl: Add a-locale * gcc-interface/Makefile.in: Add locales.c git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165812 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch5.adb')
-rw-r--r--gcc/ada/par-ch5.adb17
1 files changed, 8 insertions, 9 deletions
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index e6f28c9efba..de5883a281b 100644
--- a/gcc/ada/par-ch5.adb
+++ b/gcc/ada/par-ch5.adb
@@ -1571,8 +1571,7 @@ package body Ch5 is
Iter_Scheme_Node := New_Node (N_Iteration_Scheme, Token_Ptr);
Spec := P_Loop_Parameter_Specification;
if Nkind (Spec) = N_Loop_Parameter_Specification then
- Set_Loop_Parameter_Specification
- (Iter_Scheme_Node, Spec);
+ Set_Loop_Parameter_Specification (Iter_Scheme_Node, Spec);
else
Set_Iterator_Specification (Iter_Scheme_Node, Spec);
end if;
@@ -1701,18 +1700,16 @@ package body Ch5 is
Save_Scan_State (Scan_State);
ID_Node := P_Defining_Identifier (C_In);
- -- If the next token is OF it indicates the Ada2012 iterator. If the
- -- next token is a colon, the iterator includes a subtype indication
- -- for the bound variable of the iteration. Otherwise we parse the
- -- construct as a loop parameter specification. Note that the form:
+ -- If the next token is OF, it indicates an Ada 2012 iterator. If the
+ -- next token is a colon, this is also an Ada 2012 iterator, including a
+ -- subtype indication for the loop parameter. Otherwise we parse the
+ -- construct as a loop parameter specification. Note that the form
-- "for A in B" is ambiguous, and must be resolved semantically: if B
-- is a discrete subtype this is a loop specification, but if it is an
-- expression it is an iterator specification. Ambiguity is resolved
-- during analysis of the loop parameter specification.
- if Token = Tok_Of
- or else Token = Tok_Colon
- then
+ if Token = Tok_Of or else Token = Tok_Colon then
return P_Iterator_Specification (ID_Node);
end if;
@@ -1765,8 +1762,10 @@ package body Ch5 is
if Token = Tok_Of then
Set_Of_Present (Node1);
Scan; -- past OF
+
elsif Token = Tok_In then
Scan; -- past IN
+
else
return Error;
end if;