aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/scng.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/scng.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/scng.adb')
-rw-r--r--gcc/ada/scng.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index 74fdc14..9d3483e 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -257,6 +257,7 @@ package body Scng is
First_Non_Blank_Location := Scan_Ptr;
Initialize_Checksum;
+ Wide_Char_Byte_Count := 0;
-- Do not call Scan, otherwise the License stuff does not work in Scn
@@ -340,7 +341,10 @@ package body Scng is
-----------------------
procedure Check_End_Of_Line is
- Len : constant Int := Int (Scan_Ptr) - Int (Current_Line_Start);
+ Len : constant Int :=
+ Int (Scan_Ptr) -
+ Int (Current_Line_Start) -
+ Wide_Char_Byte_Count;
begin
if Style_Check then
@@ -362,6 +366,10 @@ package body Scng is
elsif Len > Opt.Max_Line_Length then
Error_Long_Line;
end if;
+
+ -- Reset wide character byte count for next line
+
+ Wide_Char_Byte_Count := 0;
end Check_End_Of_Line;
-----------------------