diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-05 07:56:34 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-09-05 07:56:34 +0000 |
commit | 52df6c67c170d3fd4e596232b0fea78bf695af74 (patch) | |
tree | ef0b76f32135521b32eafcdd1dffd3eb629eb4fd /gcc/ada/scng.adb | |
parent | 5136a343f985afff7daa6049e2f7ba1949319973 (diff) | |
download | gcc-52df6c67c170d3fd4e596232b0fea78bf695af74.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103875 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/scng.adb')
-rw-r--r-- | gcc/ada/scng.adb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 74fdc14a37a..9d3483e8251 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; ----------------------- |