Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Comments not retained properly for last input/output declaration #917
Author Name: Raj G
Consider the following example
When I try to display the comments of each port/net, then it displays incorrectly.
The output of this script is as shown below
As you can see, the comment is displayed as // Third, instead of // Second.
Original Redmine Comment
I agree this is wrong, but unfortunately I don't see a straightforward way to fix it given the internal design. The problem is without a terminating , or ), the parser cannot know that a variable declaration has occurred, and until that happens it likewise can't attach a comment. Ideally comments could be ordered with the parser, but that would need a fundamental redesign.
If you know each comment is one line, you could use the filename and lineno attribute of each signal to read the specified filename and grab comments from that lineno, or make a custom comment callback to collect all the comments.
Sorry. Leaving it open in case some solution comes to me.