veripool / verilog-mode

Verilog-Mode for Emacs with Indentation, Hightlighting and AUTOs. Master repository for pushing to GNU, verilog.com and veripool.org.
http://veripool.org/verilog-mode
GNU General Public License v3.0
247 stars 90 forks source link

the define macro after the `ifdef, can't mask the /*AUTOINPUT*/ and the instance #1830

Closed e665107 closed 1 year ago

e665107 commented 1 year ago

Hi Look at the examle follow:

`ifdef ADDER4
/*AUTOINPUT*/
/*AUTOOUTPUT*/
/*AUTOREG*/
adder4   adder4_inst(/*AUTOINST*/); // (vhdl not support yet)
`endif

The macro ADDER4 is undefined, but the autoinput will be expanded! And the adder4 will be detected!

If i want the right result, need write like this:

`ifdef ADDER4
///*AUTOINPUT*/
///*AUTOOUTPUT*/
///*AUTOREG*/
// adder4    adder4_inst(/*AUTOINST*/); // (vhdl not support yet)
`endif

Althouth the work is not very heavy, but it looks like some ugly! Dose this have a solution?

wsnyder commented 1 year ago

Verilog-mode does not support ifdefs: https://github.com/veripool/verilog-mode/blob/master/FAQ.rst#why-do-the-autos-ignore-my-ifdefs

there is no direct way to do this.