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

Get the capital case of the @ variable #1730

Closed imgod2u closed 3 years ago

imgod2u commented 3 years ago

I'm attempting to get the prefix of an instance as the regex of an AUTO_TEMPLATE:

/* my_module AUTO_TEMPLATE "\([a-z]+\)_" (
    .\([A-Z_]+\) (@"(upcase @)"_\1),
);
*/

When I expand, it gives me this error:

Symbol’s value as variable is void: prefix
shell returned 255

I think the @ substitution is done correctly but "upcase" interpretes this as an invalid symbol?

imgod2u commented 3 years ago

Found the solution, the @ needs to be quoted propertly:

/* my_module AUTO_TEMPLATE "\([a-z]+\)_" (
    .\([A-Z_]+\) (@"(upcase \\"@\\")"_\1),
);
*/