aboutsummaryrefslogtreecommitdiffstats
path: root/src/file_comments.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-11-23 07:55:07 +0100
committerTristan Gingold <tgingold@free.fr>2022-11-23 07:55:07 +0100
commit81295dc08948e0cf103b4597580ed95a9cc25813 (patch)
treec78d18a8b447390bbb0b21a4c46c025b31a4f453 /src/file_comments.ads
parent93a88845da27290669c0dee990b7bb7232d58139 (diff)
downloadghdl-81295dc08948e0cf103b4597580ed95a9cc25813.tar.gz
ghdl-81295dc08948e0cf103b4597580ed95a9cc25813.tar.bz2
ghdl-81295dc08948e0cf103b4597580ed95a9cc25813.zip
file_comments: add comments_range to support deferred gathering
For processes.
Diffstat (limited to 'src/file_comments.ads')
-rw-r--r--src/file_comments.ads19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/file_comments.ads b/src/file_comments.ads
index 633d15d24..aa1f3806c 100644
--- a/src/file_comments.ads
+++ b/src/file_comments.ads
@@ -37,10 +37,22 @@ package File_Comments is
-- Discard unassigned comments ?
procedure Discard_Comments (File : Source_File_Entry);
- -- Assign node N to the last comments scanned.
+ type Comments_Range_Type is private;
+
+ -- Save comments recently scanned and not yet gathered.
+ procedure Save_Comments (File : Source_File_Entry;
+ Rng : out Comments_Range_Type);
+
+ -- Assign node N to the saved RNG comments.
-- This procedure is called by the parser when a node that could be
-- annotated with a comment is parsed.
procedure Gather_Comments (File : Source_File_Entry;
+ Rng : Comments_Range_Type;
+ N : Uns32);
+
+ -- Assign node N to the last comments scanned.
+ -- Identical to Save_Comments followed by above Gather_Comments.
+ procedure Gather_Comments (File : Source_File_Entry;
N : Uns32);
-- Reassign comments to node N.
@@ -78,6 +90,11 @@ package File_Comments is
Idx : Comment_Index)
return Comment_Index;
private
+ type Comments_Range_Type is record
+ -- Range of saved comments.
+ First, Last : Comment_Index;
+ end record;
+
type Comment_Record is record
-- Comment range in the source.
Start : Source_Ptr;