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

problem with autotemplate regex with capture group reference #1379

Closed
veripoolbot opened this issue Dec 27, 2018 · 2 comments
Closed

problem with autotemplate regex with capture group reference #1379

veripoolbot opened this issue Dec 27, 2018 · 2 comments
Assignees
Labels

Comments

@veripoolbot
Copy link
Collaborator


Author Name: David Rogoff
Original Redmine Issue: 1379 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


Hi.

I use AUTO_TEMPLATE all the time - often with complex patterns. However, I'm trying something new and can't get it to work. I'm instantiating a tool-generated register block that has lots of extra prefix characters I'm trying to remove. For most, I have something like this, which works:

 .prefix_to_remove_\(.*\)   (\1),

However, for a large group of registers, the tool-generated name is

 prefix_to_remove_<name>_<name>

which should become

 <name>

I tried using a capture group to find the repeated like this, but get parsing errors from verilog-mode:

 .prefix_to_remove_\(.*\)_\1   (\1),

I tried some variations of extra back-slashes to escape things but can't get it to work.

I was using this website as a reference:

 https://www.emacswiki.org/emacs/RegularExpression

Thanks for any help!

David

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: David Rogoff
Original Date: 2018-12-28T01:15:12Z


I just confirmed that

 isearch-forward-regexp

works as expected with

 .prefix_to_remove_\(.*\)_\1

but c-c c-a returns the error

 cond: myfile.sv:1534: AUTO_TEMPLATE parsing error: .prefix_to_remove_\(.*\)_\1           (new_prefix_\1),

I even tried

 .prefix_to_remove_\(.*\)_\1   (ZZZ),

to make sure the problem wasn't with the replacement side but that generated the same error.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-01-02T23:02:42Z


Fixed in git in verilog-mode-2019-01-02-47b88f2-vpo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants