end if;
if Use_Prefix then
- Write_Str (SGR_Locus);
-
- if Full_Path_Name_For_Brief_Errors then
- Write_Name (Full_Ref_Name (Errors.Table (E).Sfile));
- else
- Write_Name (Reference_Name (Errors.Table (E).Sfile));
- end if;
-
- Write_Char (':');
- Write_Int (Int (Physical_To_Logical
- (Errors.Table (E).Line,
- Errors.Table (E).Sfile)));
- Write_Char (':');
-
- if Errors.Table (E).Col < 10 then
- Write_Char ('0');
- end if;
-
- Write_Int (Int (Errors.Table (E).Col));
- Write_Str (": ");
-
- Write_Str (SGR_Reset);
+ Output_Msg_Location (E);
end if;
Output_Msg_Text (E);
end loop;
end Output_Text_Within;
+ -------------------------
+ -- Output_Msg_Location --
+ -------------------------
+
+ procedure Output_Msg_Location (E : Error_Msg_Id) is
+ E_Obj : constant Error_Msg_Object := Errors.Table (E);
+ begin
+ Write_Str (SGR_Locus);
+
+ if Full_Path_Name_For_Brief_Errors then
+ Write_Name (Full_Ref_Name (E_Obj.Sfile));
+ else
+ Write_Name (Reference_Name (E_Obj.Sfile));
+ end if;
+
+ Write_Char (':');
+ Write_Int (Int (Physical_To_Logical (E_Obj.Line, E_Obj.Sfile)));
+ Write_Char (':');
+
+ if E_Obj.Col < 10 then
+ Write_Char ('0');
+ end if;
+
+ Write_Int (Int (E_Obj.Col));
+ Write_Str (": ");
+
+ Write_Str (SGR_Reset);
+ end Output_Msg_Location;
+
---------------------
-- Output_Msg_Text --
---------------------
-- that match or are less than the last Source_Reference pragma are listed
-- as all blanks, avoiding output of junk line numbers.
+ procedure Output_Msg_Location (E : Error_Msg_Id);
+ -- Write the location of the error message in the following format:
+ --
+ -- <File_Name>:<Line>:<Col>:
+ --
+ -- If Full_Path_Name_For_Brief_Errors then full path of the file is used.
+
procedure Output_Msg_Text (E : Error_Msg_Id);
-- Outputs characters of text in the text of the error message E. Note that
-- no end of line is output, the caller is responsible for adding the end
while E /= No_Error_Msg loop
if not Errors.Table (E).Deleted then
- if Full_Path_Name_For_Brief_Errors then
- Write_Name (Full_Ref_Name (Errors.Table (E).Sfile));
- else
- Write_Name (Reference_Name (Errors.Table (E).Sfile));
- end if;
-
- Write_Char (':');
- Write_Int (Int (Physical_To_Logical
- (Errors.Table (E).Line,
- Errors.Table (E).Sfile)));
- Write_Char (':');
-
- if Errors.Table (E).Col < 10 then
- Write_Char ('0');
- end if;
-
- Write_Int (Int (Errors.Table (E).Col));
- Write_Str (": ");
+ Output_Msg_Location (E);
Output_Msg_Text (E);
Write_Eol;
end if;