summaryrefslogtreecommitdiff
path: root/gcc/ada/casing.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-18 11:55:47 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-18 11:55:47 +0000
commitc0d15e023ae983032e6ab5127cd39414c13ea9b3 (patch)
tree4b33a5dc68585402508fa243369778006f1ade16 /gcc/ada/casing.adb
parent24ded5c146bddd8b5847df85a951e757197b8a3e (diff)
downloadgcc-c0d15e023ae983032e6ab5127cd39414c13ea9b3.tar.gz
2005-03-17 Vasiliy Fofanov <fofanov@adacore.com>
* gnat_ugn.texi: Document gnatmem restriction 2005-03-17 Thomas Quinot <quinot@adacore.com> * snames.adb: Document new TSS names introduced by exp_dist/exp_tss cleanup 2005-03-17 Robert Dewar <dewar@adacore.com> * s-interr.ads, s-interr.adb, sem_ch3.adb, prj.ads, prj.adb, a-interr.adb, a-interr.ads, s-interr-sigaction.adb, s-interr-dummy.adb, s-interr-vms.adb, s-interr-vxworks.adb: Minor reformatting * casing.adb: Comment improvements 2005-03-17 Pascal Obry <obry@adacore.com> * g-expect.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96678 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/casing.adb')
-rw-r--r--gcc/ada/casing.adb23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ada/casing.adb b/gcc/ada/casing.adb
index e2f9a485e5f..33ed33889f5 100644
--- a/gcc/ada/casing.adb
+++ b/gcc/ada/casing.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005 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- --
@@ -140,6 +140,17 @@ package body Casing is
Ptr := 1;
while Ptr <= Name_Len loop
+
+ -- Wide character. Note that we do nothing with casing in this case.
+ -- In Ada 2005 mode, required folding of lower case letters happened
+ -- as the identifier was scanned, and we do not attempt any further
+ -- messing with case (note that in any case we do not know how to
+ -- fold upper case to lower case in wide character mode). We also
+ -- do not bother with recognizing punctuation as equivalent to an
+ -- underscore. There is nothing functional at this stage in doing
+ -- the requested casing operation, beyond folding to upper case
+ -- when it is mandatory, which does not involve underscores.
+
if Name_Buffer (Ptr) = ASCII.ESC
or else Name_Buffer (Ptr) = '['
or else (Upper_Half_Encoding
@@ -148,12 +159,16 @@ package body Casing is
Skip_Wide (Name_Buffer, Ptr);
After_Und := False;
+ -- Underscore, or non-identifer character (error case)
+
elsif Name_Buffer (Ptr) = '_'
or else not Identifier_Char (Name_Buffer (Ptr))
then
After_Und := True;
Ptr := Ptr + 1;
+ -- Lower case letter
+
elsif Is_Lower_Case_Letter (Name_Buffer (Ptr)) then
if Actual_Casing = All_Upper_Case
or else (After_Und and then Actual_Casing = Mixed_Case)
@@ -164,6 +179,8 @@ package body Casing is
After_Und := False;
Ptr := Ptr + 1;
+ -- Upper case letter
+
elsif Is_Upper_Case_Letter (Name_Buffer (Ptr)) then
if Actual_Casing = All_Lower_Case
or else (not After_Und and then Actual_Casing = Mixed_Case)
@@ -174,7 +191,9 @@ package body Casing is
After_Und := False;
Ptr := Ptr + 1;
- else -- all other characters
+ -- Other identifier character (must be digit)
+
+ else
After_Und := False;
Ptr := Ptr + 1;
end if;