blob: caf01abc3cb84aa3e07981d80df0169fb78422c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- D I A G N O S T I C S . U T I L S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2024, 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- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package Diagnostics.Utils is
function Get_Human_Id (D : Diagnostic_Type) return String_Ptr;
function Sloc_To_String (Sptr : Source_Ptr; Ref : Source_Ptr) return String;
-- Convert the source pointer to a string and prefix it with the correct
-- preposition.
--
-- * If the location is in one of the standard locations,
-- then it yields "in package <LOCATION>". The explicit standard
-- locations are:
-- * System
-- * Standard
-- * Standard.ASCII
-- * if the location is missing the the sloc yields "at unknown location"
-- * if the location is in the same file as the current file,
-- then it yields "at line <line>".
-- * Otherwise sloc yields "at <file>:<line>:<column>"
function Sloc_To_String (N : Node_Or_Entity_Id;
Ref : Source_Ptr)
return String;
-- Converts the Sloc of the node or entity to a Sloc string.
function To_String (Sptr : Source_Ptr) return String;
-- Convert the source pointer to a string of the form: "file:line:column"
function To_File_Name (Sptr : Source_Ptr) return String;
-- Converts the file name of the Sptr to a string.
function Line_To_String (Sptr : Source_Ptr) return String;
-- Converts the logical line number of the Sptr to a string.
function Column_To_String (Sptr : Source_Ptr) return String;
-- Converts the column number of the Sptr to a string. Column values less
-- than 10 are prefixed with a 0.
function To_Full_Span (N : Node_Id) return Source_Span;
function To_String (Id : Diagnostic_Id) return String;
-- Convert the diagnostic ID to a 4 character string padded with 0-s.
function To_Name (E : Entity_Id) return String;
function To_Type_Name (E : Entity_Id) return String;
function Kind_To_String (D : Diagnostic_Type) return String;
function Kind_To_String
(D : Sub_Diagnostic_Type;
Parent : Diagnostic_Type) return String;
function Get_Primary_Labeled_Span (Spans : Labeled_Span_List)
return Labeled_Span_Type;
function Get_Doc_Switch (Diag : Diagnostic_Type) return String;
function Appears_Before (D1, D2 : Diagnostic_Type) return Boolean;
function Appears_Before (P1, P2 : Source_Ptr) return Boolean;
procedure Insert_Based_On_Location
(List : Diagnostic_List;
Diagnostic : Diagnostic_Type);
end Diagnostics.Utils;
|