verilog_systemverilog.vim icon indicating copy to clipboard operation
verilog_systemverilog.vim copied to clipboard

Preprocessor statements break indentation.

Open lewis6991 opened this issue 9 years ago • 3 comments

my_module u_my_instance(
  `ifdef TEST
    .port1 (wire1),
  `endif
  .port2 (wire2)
);

  logic a; // Incorrect indentation.

lewis6991 avatar May 19 '16 07:05 lewis6991

Found another case which causes them to break:

if (`SOME_TYPE(var))
  a = b; // Incorrect indentation.

lewis6991 avatar Jun 10 '16 13:06 lewis6991

More examples.

In the following scenarios my_function() has one extra indentation level:

  assign test = {
      3'b0
    , `ifdef SOMETHING 1'b1 `else 1'b0 `endif
  };
    my_function();

or:

  assign test = {
      3'b0
    `ifdef SOMETHING
    , 1'b1
    `endif
  };
    my_function();

vhda avatar Jul 01 '16 16:07 vhda

I've been working on something for a while that should address this among a few other issues.

lewis6991 avatar Jul 01 '16 16:07 lewis6991