Function: verilog-auto-templated-rel
verilog-auto-templated-rel is a byte-compiled function defined in
verilog-mode.el.gz.
Signature
(verilog-auto-templated-rel)
Documentation
Replace Templated relative line numbers with absolute line numbers.
Internal use only. This hacks around the line numbers in AUTOINST Templates being different from the final output's line numbering.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-auto-templated-rel ()
"Replace Templated relative line numbers with absolute line numbers.
Internal use only. This hacks around the line numbers in AUTOINST Templates
being different from the final output's line numbering."
(let ((templateno 0) (template-line (list 0)) (buf-line 1))
;; Find line number each template is on
;; Count lines as we go, as otherwise it's O(n^2) to use count-lines
(goto-char (point-min))
(while (not (eobp))
(when (looking-at ".*AUTO_TEMPLATE")
(setq templateno (1+ templateno))
(setq template-line (cons buf-line template-line)))
(setq buf-line (1+ buf-line))
(forward-line 1))
(setq template-line (nreverse template-line))
;; Replace T# L# with absolute line number
(goto-char (point-min))
(while (re-search-forward " Templated T\\([0-9]+\\) L\\([0-9]+\\)" nil t)
(replace-match
(concat " Templated "
(int-to-string (+ (nth (string-to-number
(match-string-no-properties 1))
template-line)
(string-to-number
(match-string-no-properties 2)))))
t t))))