This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Recognize Verilog edge identifiers
ClosedPublic

Authored by sstwcw on Apr 30 2023, 4:53 PM.

Details

Summary

Previously the event expression would be misidentified as a port list.
A line break would be added after the comma. The events can be
separated with either a comma or the or keyword, and a line break
would not be inserted if the or keyword was used. We changed the
behavior of the comma to match the or keyword.

Before:

always @(posedge x,
         posedge y)
  x <= x;
always @(posedge x or posedge y)
  x <= x;

After:

always @(posedge x, posedge y)
  x <= x;
always @(posedge x or posedge y)
  x <= x;

Diff Detail

Event Timeline

sstwcw created this revision.Apr 30 2023, 4:53 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptApr 30 2023, 4:53 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sstwcw requested review of this revision.Apr 30 2023, 4:53 PM

Could you add anotator tests?

sstwcw updated this revision to Diff 518752.May 2 2023, 8:32 AM
  • add annotator test
This revision is now accepted and ready to land.May 2 2023, 12:22 PM
This revision was automatically updated to reflect the committed changes.