aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch13.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-ch13.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-ch13.adb')
-rw-r--r--gcc/ada/par-ch13.adb39
1 files changed, 31 insertions, 8 deletions
diff --git a/gcc/ada/par-ch13.adb b/gcc/ada/par-ch13.adb
index 2265bbf..5f448f6 100644
--- a/gcc/ada/par-ch13.adb
+++ b/gcc/ada/par-ch13.adb
@@ -45,6 +45,26 @@ package body Ch13 is
Scan_State : Saved_Scan_State;
Result : Boolean;
+ function Possible_Misspelled_Aspect return Boolean;
+ -- Returns True, if Token_Name is a misspelling of some aspect name
+
+ --------------------------------
+ -- Possible_Misspelled_Aspect --
+ --------------------------------
+
+ function Possible_Misspelled_Aspect return Boolean is
+ begin
+ for J in Aspect_Id_Exclude_No_Aspect loop
+ if Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J)) then
+ return True;
+ end if;
+ end loop;
+
+ return False;
+ end Possible_Misspelled_Aspect;
+
+ -- Start of processing for Aspect_Specifications_Present
+
begin
-- Definitely must have WITH to consider aspect specs to be present
@@ -74,17 +94,20 @@ package body Ch13 is
if Token /= Tok_Identifier then
Result := False;
- -- This is where we pay attention to the Strict mode. Normally when we
- -- are in Ada 2012 mode, Strict is False, and we consider that we have
- -- an aspect specification if the identifier is an aspect name (even if
- -- not followed by =>) or the identifier is not an aspect name but is
- -- followed by =>, by a comma, or by a semicolon. The last two cases
- -- correspond to (misspelled) Boolean aspects with a defaulted value of
- -- True. P_Aspect_Specifications will generate messages if the aspect
+ -- This is where we pay attention to the Strict mode. Normally when
+ -- we are in Ada 2012 mode, Strict is False, and we consider that we
+ -- have an aspect specification if the identifier is an aspect name
+ -- or a likely misspelling of one (even if not followed by =>) or
+ -- the identifier is not an aspect name but is followed by =>, by
+ -- a comma, or by a semicolon. The last two cases correspond to
+ -- (misspelled) Boolean aspects with a defaulted value of True.
+ -- P_Aspect_Specifications will generate messages if the aspect
-- specification is ill-formed.
elsif not Strict then
- if Get_Aspect_Id (Token_Name) /= No_Aspect then
+ if Get_Aspect_Id (Token_Name) /= No_Aspect
+ or else Possible_Misspelled_Aspect
+ then
Result := True;
else
Scan; -- past identifier