Function: verilog-in-case-region-p

verilog-in-case-region-p is an interactive and byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-in-case-region-p)

Documentation

Return non-nil if in a case region.

More specifically, point @ in the line foo : @ begin

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-in-case-region-p ()
  "Return non-nil if in a case region.
More specifically, point @ in the line foo : @ begin"
  (interactive)
  (save-excursion
    (if (and
	 (progn (verilog-forward-syntactic-ws)
		(looking-at "\\<begin\\>"))
	 (progn (verilog-backward-syntactic-ws)
		(= (preceding-char) ?\:)))
	(catch 'found
	  (let ((nest 1))
	    (while t
	      (verilog-re-search-backward
              (concat "\\(\\<module\\>\\)\\|\\(\\<connectmodule\\>\\)\\|\\(\\<randcase\\>\\|\\<case[xz]?\\>[^:]\\)\\|"
		       "\\(\\<endcase\\>\\)")
	       nil 'move)
	      (cond
              ((match-end 4)
		(setq nest (1+ nest)))
              ((match-end 3)
		(if (= nest 1)
		    (throw 'found 1))
		(setq nest (1- nest)))
	       (t
		(throw 'found (= nest 0)))))))
      nil)))