Function: verilog-repair-open-comma

verilog-repair-open-comma is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-repair-open-comma)

Documentation

Insert comma if previous argument is other than an open parenthesis or endif.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-repair-open-comma ()
  "Insert comma if previous argument is other than an open parenthesis or endif."
  ;; We can't just search backward for ) as it might be inside another expression.
  ;; Also want "`ifdef X   input foo   `endif" to just leave things to the human to deal with
  (save-excursion
    (verilog-backward-syntactic-ws-quick)
    (when (and (not (save-excursion  ; Not beginning (, or existing ,
		      (backward-char 1)
		      (looking-at "[(,]")))
               (not (save-excursion  ; Not attribute *)
		      (backward-char 2)
		      (looking-at "\\*)")))
               (not (save-excursion  ; Not `endif, or user define
		      (backward-char 1)
		      (skip-chars-backward "a-zA-Z0-9_`")
		      (looking-at "`"))))
      (insert ","))))