blob: c7b98509e9202afa31ecede684b811d4d07b015a (
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
|
-- Specialisation of File_Comments for vhdl
-- Copyright (C) 2022 Tristan Gingold
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT 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
-- along with this program. If not, see <gnu.org/licenses>.
-- All the variables declared in this package are set by Parse_Option function
-- and can by read as soon as the command line is parsed.
--
-- Since the names are not prefixed, this package is expected to be with'ed
-- but not to be use'd.
with Files_Map;
with Vhdl.Scanner; use Vhdl.Scanner;
package body Vhdl.Comments is
procedure Gather_Comments (N : Iir) is
begin
Gather_Comments (Get_Current_Source_File, Uns32 (N));
end Gather_Comments;
function Find_First_Comment (File : Source_File_Entry; N : Node)
return Comment_Index
is
pragma Assert (Files_Map.Location_To_File (Get_Location (N)) = File);
begin
return Find_First_Comment (File, Uns32 (N));
end Find_First_Comment;
end Vhdl.Comments;
|