diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-11-23 07:55:07 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-11-23 07:55:07 +0100 |
commit | 81295dc08948e0cf103b4597580ed95a9cc25813 (patch) | |
tree | c78d18a8b447390bbb0b21a4c46c025b31a4f453 /src/vhdl/vhdl-parse.adb | |
parent | 93a88845da27290669c0dee990b7bb7232d58139 (diff) | |
download | ghdl-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/vhdl/vhdl-parse.adb')
-rw-r--r-- | src/vhdl/vhdl-parse.adb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb index 532e6c8f8..d24cde24d 100644 --- a/src/vhdl/vhdl-parse.adb +++ b/src/vhdl/vhdl-parse.adb @@ -8562,15 +8562,27 @@ package body Vhdl.Parse is Res: Iir; Sensitivity_List : Iir_List; Start_Loc, Begin_Loc, End_Loc : Location_Type; + Comments_Rng : File_Comments.Comments_Range_Type; begin Start_Loc := Get_Token_Location; + -- Attach comments now, as 'process' may appear alone, followed + -- by a comment for the next declaration. + if Flag_Gather_Comments then + Save_Comments (Comments_Rng); + end if; + -- Skip 'process' Scan; if Current_Token = Tok_Left_Paren then Res := Create_Iir (Iir_Kind_Sensitized_Process_Statement); + -- Comments for the process. + if Flag_Gather_Comments then + Gather_Comments (Comments_Rng, Res); + end if; + -- Skip '(' Scan; @@ -8589,6 +8601,11 @@ package body Vhdl.Parse is Expect_Scan (Tok_Right_Paren); else Res := Create_Iir (Iir_Kind_Process_Statement); + + -- Comments for the process. + if Flag_Gather_Comments then + Gather_Comments (Comments_Rng, Res); + end if; end if; Set_Location (Res, Loc); |