Function: vhdl-end-of-block

vhdl-end-of-block is a byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-end-of-block)

Documentation

Move cursor to the end of the enclosing block.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-end-of-block ()
  "Move cursor to the end of the enclosing block."
  (let (pos)
    (vhdl-prepare-search-2
     (save-excursion
       (end-of-line)
       ;; search forward for block beginning or end
       (while (or (while (and (setq pos (re-search-forward "^\\s-*\\(\\(end\\)\\|\\(\\(impure\\|pure\\)[ \t\n\r\f]+\\)?\\(function\\|procedure\\)\\|\\(for\\)\\|\\(architecture\\|component\\|configuration\\|context\\|entity\\|package\\(\\s-+body\\)?\\|type[ \t\n\r\f]+\\w+[ \t\n\r\f]+is[ \t\n\r\f]+\\(record\\|protected\\(\\s-+body\\)?\\)\\|units\\)\\|\\(\\w+[ \t\n\r\f]*:[ \t\n\r\f]*\\)?\\(postponed[ \t\n\r\f]+\\)?\\(block\\|case\\|for\\|if\\|procedural\\|process\\|while\\|loop\\)\\)\\>" nil t))
			      ;; not consider subprogram declarations
			      (or (and (match-string 5)
				       (save-match-data
					 (save-excursion (re-search-forward "\\<is\\>\\|\\(;\\)" nil t))
					 (match-string 1)))
				  ;; not consider configuration specifications
				  (and (match-string 6)
				       (save-match-data
					 (save-excursion
					   (vhdl-end-of-block)
					   (beginning-of-line)
					   (not (looking-at "^\\s-*end\\s-+\\(for\\|generate\\|loop\\)\\>"))))))))
		  (not (match-string 2)))
	 ;; skip subblock if block beginning found
	 (vhdl-end-of-block))))
    (when pos (goto-char pos))))