p4c
p4c copied to clipboard
[P4fmt]: Add comment printing capability to `P4Formatter`
This builds on top off #4845(which traverses the AST and builds a side map for storing comments associated with each node). This PR uses that map to retrieve and print comments through the P4Formatter pretty-printer.
Support for new nodes are being added continuously.
Is this expected to replace #4845?
Is this expected to replace #4845?
No. This builds on top of #4845, 4845 stores comments associated with each IR nodes, this PR implements the printing capabilities to the P4Formatter (p-printer) by using that side map.
I will rebase this as soon as 4845 is merged.
@snapdgn Could you rebase this now that #4845 is merged?
@snapdgn Could you rebase this now that #4845 is merged?
Sorry. Was caught up in something.This needs a little work. Will do this asap. Update: Might need a little time on this one, Currently caught up in Semester Exams.