Function: verilog--pretty-declarations-find-end

verilog--pretty-declarations-find-end is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog--pretty-declarations-find-end &optional REG-END)

Documentation

Find end position for current alignment of declarations.

If region is active, use arg REG-END to set a limit on the alignment.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog--pretty-declarations-find-end (&optional reg-end)
  "Find end position for current alignment of declarations.
If region is active, use arg REG-END to set a limit on the alignment."
  (let (e)
    (if (and (verilog-parenthesis-depth)
             (not (verilog-in-struct-p)))
        ;; In an argument list or parameter block
        (progn
          (verilog-backward-up-list -1)
          (forward-char -1)
          (verilog-backward-syntactic-ws)
          (if (region-active-p)
              (min reg-end (point))
            (point)))
      ;; In a declaration block (not in argument list)
      (verilog-end-of-statement)
      (setq e (point)) ; Might be on last line
      (verilog-forward-syntactic-ws)
      (while (verilog-looking-at-decl-to-align)
        (verilog-end-of-statement)
        (setq e (point))
        (verilog-forward-syntactic-ws))
      (if (region-active-p)
          (min reg-end e)
        e))))