p4c icon indicating copy to clipboard operation
p4c copied to clipboard

[P4fmt]: Add comment printing capability to `P4Formatter`

Open snapdgn opened this issue 1 year ago • 4 comments

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.

snapdgn avatar Aug 27 '24 13:08 snapdgn

Is this expected to replace #4845?

qobilidop avatar Aug 27 '24 16:08 qobilidop

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 avatar Aug 27 '24 16:08 snapdgn

@snapdgn Could you rebase this now that #4845 is merged?

fruffy avatar Nov 07 '24 20:11 fruffy

@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.

snapdgn avatar Nov 07 '24 20:11 snapdgn