aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/widechar.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2005-09-05 09:56:34 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2005-09-05 09:56:34 +0200
commitd52f1094e50cf2120eebc5bf2a63ed0aa56c825a (patch)
treeef0b76f32135521b32eafcdd1dffd3eb629eb4fd /gcc/ada/widechar.adb
parent09245ac9a7cb99f101e243591ecacef5342cbee7 (diff)
downloadgcc-d52f1094e50cf2120eebc5bf2a63ed0aa56c825a.zip
gcc-d52f1094e50cf2120eebc5bf2a63ed0aa56c825a.tar.gz
gcc-d52f1094e50cf2120eebc5bf2a63ed0aa56c825a.tar.bz2
scng.adb (Check_End_Of_Line): Count characters, rather than bytes (makes a difference for wide characters)
2005-09-01 Robert Dewar <dewar@adacore.com> * scng.adb (Check_End_Of_Line): Count characters, rather than bytes (makes a difference for wide characters) * widechar.adb, widechar.ads: Add Wide_Char_Byte_Count feature to count chars vs bytes From-SVN: r103875
Diffstat (limited to 'gcc/ada/widechar.adb')
-rw-r--r--gcc/ada/widechar.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/widechar.adb b/gcc/ada/widechar.adb
index 9641251..e199928 100644
--- a/gcc/ada/widechar.adb
+++ b/gcc/ada/widechar.adb
@@ -88,6 +88,8 @@ package body Widechar is
C : out Char_Code;
Err : out Boolean)
is
+ P_Init : constant Source_Ptr := P;
+
function In_Char return Character;
-- Function to obtain characters of wide character escape sequence
@@ -108,6 +110,7 @@ package body Widechar is
begin
C := Char_Code (WC_In (In_Char, Wide_Character_Encoding_Method));
Err := False;
+ Wide_Char_Byte_Count := Wide_Char_Byte_Count + Nat (P - P_Init - 1);
exception
when Constraint_Error =>
@@ -151,6 +154,8 @@ package body Widechar is
---------------
procedure Skip_Wide (S : String; P : in out Natural) is
+ P_Init : constant Natural := P;
+
function Skip_Char return Character;
-- Function to skip one character of wide character escape sequence
@@ -173,6 +178,7 @@ package body Widechar is
begin
Discard := WC_Skip (Skip_Char, Wide_Character_Encoding_Method);
+ Wide_Char_Byte_Count := Wide_Char_Byte_Count + Nat (P - P_Init - 1);
end Skip_Wide;
---------------
@@ -180,6 +186,8 @@ package body Widechar is
---------------
procedure Skip_Wide (S : Source_Buffer_Ptr; P : in out Source_Ptr) is
+ P_Init : constant Source_Ptr := P;
+
function Skip_Char return Character;
-- Function to skip one character of wide character escape sequence
@@ -202,6 +210,7 @@ package body Widechar is
begin
Discard := WC_Skip (Skip_Char, Wide_Character_Encoding_Method);
+ Wide_Char_Byte_Count := Wide_Char_Byte_Count + Nat (P - P_Init - 1);
end Skip_Wide;
end Widechar;