Function: verilog--pretty-expr-assignment-found

verilog--pretty-expr-assignment-found is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog--pretty-expr-assignment-found &optional DISCARD-RE)

Documentation

Return non-nil if point is at a valid assignment operation to be aligned.

Ensure cursor is not over DISCARD-RE (e.g. Verilog keywords). If returned non-nil, update match data according to verilog-assignment-operation-re.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog--pretty-expr-assignment-found (&optional discard-re)
  "Return non-nil if point is at a valid assignment operation to be aligned.
Ensure cursor is not over DISCARD-RE (e.g. Verilog keywords).
If returned non-nil, update match data according to `verilog-assignment-operation-re'."
  ;; Not looking at a verilog keyword sentence (i.e looking at a potential assignment)
  (and (if discard-re
           (not (looking-at discard-re))
         t)
       ;; Corner case to filter first parameter on param lists
       (save-excursion
         (if (and (verilog-re-search-forward verilog-assignment-operation-re (point-at-eol) 'move)
                  (verilog-in-parenthesis-p))
             (progn (verilog-backward-up-list 1)
                    (forward-char 1)
                    (not (eq 0 (string-match discard-re (buffer-substring-no-properties (point) (point-at-eol))))))
           t))
       ;; Don't work on multiline assignments unless they are continued lines
       ;; e.g, multiple parameters or variable declarations in the same statement
       (if (save-excursion
             (and (not (verilog-in-parameter-p))
                  (verilog-continued-line)
                  (not (looking-at verilog-basic-complete-re))))
           (save-excursion
             (verilog-beg-of-statement-1)
             (looking-at (verilog-get-declaration-re)))
         t)
       ;; Ensure it's not any kind of logical comparison
       (save-excursion
         (unless (and (not (verilog-in-parameter-p))
                      (verilog-re-search-forward (verilog-regexp-words '("if" "for" "assert" "with")) (point-at-eol) 'move))
           t))
       ;; Looking at an assignment (last check, provides match data)
       (looking-at verilog-assignment-operation-re)))