aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2007-08-14 10:48:45 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-08-14 10:48:45 +0200
commitb63e38373ac562255170a83368a892ddfb77c98e (patch)
tree1b91a0937992fafbb540af5ea59e26fe87c71d89 /gcc
parent4993417734d33d95cc9e41bf3db65b869331135e (diff)
downloadgcc-b63e38373ac562255170a83368a892ddfb77c98e.zip
gcc-b63e38373ac562255170a83368a892ddfb77c98e.tar.gz
gcc-b63e38373ac562255170a83368a892ddfb77c98e.tar.bz2
output.ads, output.adb (Write_Eol): Remove trailing spaces before writing the line.
2007-08-14 Vincent Celier <celier@adacore.com> * output.ads, output.adb (Write_Eol): Remove trailing spaces before writing the line. (Write_Eol_Keep_Blanks): New procedure to write a line, including possible trailing spaces. (Output_Source_Line): Call Write_Eol_Keep_Blanks to output a source line From-SVN: r127456
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/output.adb17
-rw-r--r--gcc/ada/output.ads7
2 files changed, 22 insertions, 2 deletions
diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb
index b606ccc..6a2a723 100644
--- a/gcc/ada/output.adb
+++ b/gcc/ada/output.adb
@@ -254,11 +254,28 @@ package body Output is
procedure Write_Eol is
begin
+ -- Remove any trailing space
+
+ while Next_Col > 1 and then Buffer (Next_Col - 1) = ' ' loop
+ Next_Col := Next_Col - 1;
+ end loop;
+
Buffer (Next_Col) := ASCII.LF;
Next_Col := Next_Col + 1;
Flush_Buffer;
end Write_Eol;
+ ---------------------------
+ -- Write_Eol_Keep_Blanks --
+ ---------------------------
+
+ procedure Write_Eol_Keep_Blanks is
+ begin
+ Buffer (Next_Col) := ASCII.LF;
+ Next_Col := Next_Col + 1;
+ Flush_Buffer;
+ end Write_Eol_Keep_Blanks;
+
----------------------
-- Write_Erase_Char --
----------------------
diff --git a/gcc/ada/output.ads b/gcc/ada/output.ads
index 7273ce5..95da496 100644
--- a/gcc/ada/output.ads
+++ b/gcc/ada/output.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, 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- --
@@ -95,7 +95,10 @@ package Output is
-- e.g. CR/LF for DOS, or LF for Unix) to the standard output file.
-- This routine also empties the line buffer, actually writing it
-- to the file. Note that Write_Eol is the only routine that causes
- -- any actual output to be written.
+ -- any actual output to be written. Trailing spaces are removed.
+
+ procedure Write_Eol_Keep_Blanks;
+ -- Similar as Write_Eol, except that trailing spaces are not removed
procedure Write_Int (Val : Int);
-- Write an integer value with no leading blanks or zeroes. Negative