Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[space] Unneeded space in ternaries #43

Closed
msfschaffner opened this issue Nov 26, 2019 · 2 comments
Closed

[space] Unneeded space in ternaries #43

msfschaffner opened this issue Nov 26, 2019 · 2 comments
Assignees
Labels
formatter Verilog code formatter issues good first issue Good for newcomers

Comments

@msfschaffner
Copy link

should:

  assign usb_tx_rready = sys_loopback ? lb_data_move : usb_if_tx_read;
  assign usb_rx_wvalid = sys_loopback ? lb_data_move : usb_if_rx_write;
  assign usb_rx_fifo_wdata = sys_loopback ? usb_tx_fifo_rdata : usb_if_rx_fifo_wdata;

is:

  assign usb_tx_rready = sys_loopback ? lb_data_move      : usb_if_tx_read;
  assign usb_rx_wvalid = sys_loopback ? lb_data_move      : usb_if_rx_write;
  assign usb_rx_fifo_wdata = sys_loopback ? usb_tx_fifo_rdata : usb_if_rx_fifo_wdata;
@msfschaffner
Copy link
Author

b/145170233

@fangism fangism added the formatter Verilog code formatter issues label Nov 26, 2019
@fangism
Copy link
Collaborator

fangism commented Nov 26, 2019

This case not handled, should be an easy fix.

Reduced test case:

module m;
assign r = a ? b : c;
endmodule
$ verilog_format -v=4 --alsologtostderr  ~/testing/verilog/formatting/b145170233.sv
...
I1125 18:50:51.146008   96624 token_annotator.cc:114] Spacing between SymbolIdentifier and ':'
I1125 18:50:51.146015   96624 token_annotator.cc:315] spaces: -1, reason: Default: spacing not explicitly handled
I1125 18:50:51.146022   96624 token_annotator.cc:320] Unhandled inter-token spacing between SymbolIdentifier and ':', defaulting to 1

By default, 'unhandled' cases preserve original spacing, which explains why you still see multiple spaces.

@fangism fangism added the good first issue Good for newcomers label Nov 26, 2019
@fangism fangism added this to Inter-token (horizontal) spacing in SV formatter Nov 26, 2019
@fangism fangism self-assigned this Nov 26, 2019
@hzeller hzeller closed this as completed in 8296fd3 Dec 2, 2019
nikhiljha pushed a commit to nikhiljha/verible that referenced this issue Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Verilog code formatter issues good first issue Good for newcomers
Projects
SV formatter
Inter-token (horizontal) spacing
Development

No branches or pull requests

2 participants