aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/casing.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2005-03-18 12:55:47 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-03-18 12:55:47 +0100
commitfa7c4d231fb72d7a522f3894ea121177a899fdec (patch)
tree4b33a5dc68585402508fa243369778006f1ade16 /gcc/ada/casing.adb
parent8095d0fa91c3cc9af26742b032159149b9f1e9d4 (diff)
downloadgcc-fa7c4d231fb72d7a522f3894ea121177a899fdec.zip
gcc-fa7c4d231fb72d7a522f3894ea121177a899fdec.tar.gz
gcc-fa7c4d231fb72d7a522f3894ea121177a899fdec.tar.bz2
[multiple changes]
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. From-SVN: r96678
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 e2f9a48..33ed338 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;