Function: verilog-declaration-varname-matcher

verilog-declaration-varname-matcher is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-declaration-varname-matcher LIMIT)

Documentation

Match first variable name b/w POINT & LIMIT, move POINT to next variable.

Expected to be called within a declaration statement, with POINT already beyond the declaration keyword and range ([a:b]) This function moves POINT to the next variable within the same declaration (if it exists). LIMIT is expected to be the pos at which current single-declaration ends, obtained using verilog-single-declaration-end.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-declaration-varname-matcher (limit)
  "Match first variable name b/w POINT & LIMIT, move POINT to next variable.
Expected to be called within a declaration statement, with POINT already beyond
the declaration keyword and range ([a:b])
This function moves POINT to the next variable within the same declaration (if
it exists).
LIMIT is expected to be the pos at which current single-declaration ends,
obtained using `verilog-single-declaration-end'."

  (let (found-var old-point)

    ;; Remove starting whitespace
    (verilog-forward-ws&directives limit)

    (when (< (point) limit) ;; no matching if this is violated

      ;; Find the variable name (match-data is set here)
      (setq found-var (re-search-forward verilog-symbol-re limit t))

      ;; Walk to this variable's delimiter
      (save-match-data
        (verilog-forward-ws&directives limit)
        (setq old-point nil)
        (while (and (< (point) limit)
                    (not (member (char-after) '(?, ?\) ?\;)))
                    (not (eq old-point (point))))
          (setq old-point (point))
          (verilog-forward-ws&directives limit)
          (forward-sexp)
          (verilog-forward-ws&directives limit))
        ;; Only a comma or semicolon expected at this point
        (skip-syntax-forward "."))
      found-var)))