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

verilog-goto-defun can't not list tasks and functions #1492

Closed
veripoolbot opened this issue Aug 26, 2019 · 1 comment
Closed

verilog-goto-defun can't not list tasks and functions #1492

veripoolbot opened this issue Aug 26, 2019 · 1 comment
Assignees

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Enze Chi
Original Redmine Issue: 1492 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


When run the verilog-goto-defun command in verilog file buffer, the functions and tasks are not listed as candidates.

As in the verilog-build-defun-re function, the original regexp only match with function/task start with no leading spaces and not taking "automatic|static" keywords and return type before function name into account.


(defun verilog-build-defun-re (str &optional arg)
  "Return function/task/module starting with STR as regular expression.
With optional second ARG non-nil, STR is the complete name of the instruction."
  (if arg
       (concat "^\\(function\\|task\\|module\\)[ \t]+\\(" str "\\)\\>")
     (concat "^\\(function\\|task\\|module\\)[ \t]+\\(" str "[a-zA-Z0-9_ ]*\\)\\>")))

I did a little bit local hack as below, the function and task names are presented as candidates now:


(defun verilog-build-defun-re (str &optional arg)
  "Return function/task/module starting with STR as regular expression.
With optional second ARG non-nil, STR is the complete name of the instruction."
  (if arg
       (concat "^[ \t]*\\(function\\|task\\|module\\)[ \t]+\\(automatic\\|static\\)*\\(" str "\\)\\>")
     (concat "^[ \t]*\\(function\\|task\\|module\\)[ \t]+\\(automatic\\|static\\)*\\(" str "[a-zA-Z0-9_ ]*\\)\\>")))

Also tweak required for verilog-comp-defun as more matched items may be found.

As the swiper package does great job for searching, it maybe good to delicate this functionality to it. The "class|package|interface", etc can all be found easily.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-08-27T17:41:49Z


Thanks for the report. Fixed this in git and verilog-mode-2019-08-27-be9b5af-vpo.

Note "swiper" can't be used by default as it's not distributed with Emacs itself (as Verilog-mode is).

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

No branches or pull requests

2 participants