Function: verilog-func-completion

verilog-func-completion is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-func-completion TYPE)

Documentation

Build regular expression for module/task/function names.

TYPE is module, tf for task or function, or t if unknown.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
;; Calculate all possible completions for functions if argument is `function',
;; completions for procedures if argument is `procedure' or both functions and
;; procedures otherwise.

(defun verilog-func-completion (type)
  "Build regular expression for module/task/function names.
TYPE is `module', `tf' for task or function, or t if unknown."
  (if (string= verilog-str "")
      (setq verilog-str "[a-zA-Z_]"))
  (let ((verilog-str
         (concat (cond
                  ((eq type 'module) "\\<\\(module\\|connectmodule\\)\\s +")
                  ((eq type 'tf) "\\<\\(task\\|function\\)\\s +")
                  (t "\\<\\(task\\|function\\|module\\|connectmodule\\)\\s +"))
                 "\\<\\(" verilog-str "[a-zA-Z0-9_.]*\\)\\>"))
	match)

    (save-excursion
      (if (not (looking-at verilog-defun-re))
	  (verilog-re-search-backward verilog-defun-re nil t))
      (forward-char 1)

      ;; Search through all reachable functions
      (goto-char (point-min))
      (while (verilog-re-search-forward verilog-str (point-max) t)
        (setq match (buffer-substring (match-beginning 2)
				      (match-end 2)))
        (setq verilog-all (cons match verilog-all))))))