Function: verilog-backward-ws&directives

verilog-backward-ws&directives is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-backward-ws&directives &optional BOUND)

Documentation

Backward skip over syntactic whitespace and compiler directives for Emacs 19.

Optional BOUND limits search.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-backward-ws&directives (&optional bound)
  "Backward skip over syntactic whitespace and compiler directives for Emacs 19.
Optional BOUND limits search."
  (save-restriction
    (let* ((bound (or bound (point-min)))
	   (here bound)
	   (p nil) )
      (if (< bound (point))
	  (progn
	    (let ((state (save-excursion (verilog-syntax-ppss))))
	      (cond
               ((nth 7 state)  ; in // comment
		(verilog-re-search-backward "//" nil 'move)
                (skip-chars-backward "/"))
               ((nth 4 state)  ; in /* */ comment
		(verilog-re-search-backward "/\\*" nil 'move))))
	    (narrow-to-region bound (point))
	    (while (/= here (point))
	      (setq here (point))
	      (verilog-skip-backward-comments)
	      (setq p
		    (save-excursion
		      (beginning-of-line)
		      ;; for as long as we're right after a continued line, keep moving up
		      (while (and (verilog-looking-back "\\\\[\n\r\f]" nil)
                                  (forward-line -1)))
		      (cond
		       ((and verilog-highlight-translate-off
			     (verilog-within-translate-off))
			(verilog-back-to-start-translate-off (point-min)))
		       ((looking-at verilog-directive-re-1)
			(point))
		       (t
			nil))))
	      (if p (goto-char p))))))))