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
257 stars 90 forks source link

Invalid use of ‘\’ in replacement text #1724

Closed imgod2u closed 3 years ago

imgod2u commented 3 years ago

Following up on the closed issue here:

https://github.com/veripool/verilog-mode/issues/1077

I attempted the suggested solution but in simplified form:

.\(.*\) (@"(verilog-replace-regexp \\"\(.*\)M0\\" \\"srcinst_\1\\" (downcase vl-name))"),

Basically take out the "M0" portion and prepend "srcinst_".

However, I get the following failure when evaluating the AUTO_TEMPLATE:

Invalid use of ‘\’ in replacement text

I'm not familiar enough with the plethora of escapes that are going on to properly debug. Could someone help?

wsnyder commented 3 years ago

See #1077. In a @ lisp template, each quote needs a double backslash, and backslash any other backslash (double the other backslashes).