aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-10-20 16:27:24 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-10-20 16:27:24 +0200
commita905304c94475f67c263b5f0012e3cda8feb41ca (patch)
tree06ace340b52d9a92dbf95ddb7498cd8f659ad4e5 /gcc/ada/par-ch4.adb
parent49d413972612664513ab9b69934359563616b846 (diff)
downloadgcc-a905304c94475f67c263b5f0012e3cda8feb41ca.zip
gcc-a905304c94475f67c263b5f0012e3cda8feb41ca.tar.gz
gcc-a905304c94475f67c263b5f0012e3cda8feb41ca.tar.bz2
[multiple changes]
2014-10-20 Tristan Gingold <gingold@adacore.com> * init.c (__gnat_is_stack_guard): Don't use mach_vm_region_recurse on arm-darwin. * raise-gcc.c: Add ATTRIBUTE_UNUSED to remove warnings for unused arguments. 2014-10-20 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.adb (Analyze_Attribute): Replace variables CS and PS with Proc_Id and Subp_Id to better illustrate their purpose. Account for the case where _Postconditions has not been generated yet and the context is aspect/pragma Refined_Post. In that scenario the expected prefix of attribute 'Result is the current scope. 2014-10-20 Robert Dewar <dewar@adacore.com> * par-ch4.adb (P_Expression): Handle extraneous comma/semicolon in middle of expression with logical operators. 2014-10-20 Robert Dewar <dewar@adacore.com> * par-ch13.adb (Possible_Misspelled_Aspect): New function. 2014-10-20 Steve Baird <baird@adacore.com> * pprint.adb: Improve Expression_Image function. From-SVN: r216477
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r--gcc/ada/par-ch4.adb42
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 8f6da4e..071853a 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -1708,6 +1708,48 @@ package body Ch4 is
Node1 := New_Op_Node (Logical_Op, Op_Location);
Set_Left_Opnd (Node1, Node2);
Set_Right_Opnd (Node1, P_Relation);
+
+ -- Check for case of errant comma or semicolon
+
+ if Token = Tok_Comma or else Token = Tok_Semicolon then
+ declare
+ Com : constant Boolean := Token = Tok_Comma;
+ Scan_State : Saved_Scan_State;
+ Logop : Node_Kind;
+
+ begin
+ Save_Scan_State (Scan_State); -- at comma/semicolon
+ Scan; -- past comma/semicolon
+
+ -- Check for AND THEN or OR ELSE after comma/semicolon. We
+ -- do not deal with AND/OR because those cases get mixed up
+ -- with the select alternatives case.
+
+ if Token = Tok_And or else Token = Tok_Or then
+ Logop := P_Logical_Operator;
+ Restore_Scan_State (Scan_State); -- to comma/semicolon
+
+ if Nkind_In (Logop, N_And_Then, N_Or_Else) then
+ Scan; -- past comma/semicolon
+
+ if Com then
+ Error_Msg_SP -- CODEFIX
+ ("|extra "","" ignored");
+ else
+ Error_Msg_SP -- CODEFIX
+ ("|extra "";"" ignored");
+ end if;
+
+ else
+ Restore_Scan_State (Scan_State); -- to comma/semicolon
+ end if;
+
+ else
+ Restore_Scan_State (Scan_State); -- to comma/semicolon
+ end if;
+ end;
+ end if;
+
exit when Token not in Token_Class_Logop;
end loop;