Function: verilog-skip-backward-comments

verilog-skip-backward-comments is a byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-skip-backward-comments)

Documentation

Return true if a comment was skipped.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-skip-backward-comments ()
  "Return true if a comment was skipped."
  (let ((more t))
    (while more
      (setq more
            (let ((state (save-excursion (verilog-syntax-ppss))))
              (cond
               ((nth 7 state)			;Inside // comment
                (search-backward "//")
                (skip-chars-backward "/")
                (skip-chars-backward " \t\n\f")
                t)
               ((nth 4 state)			;Inside /* */ comment
                (search-backward "/*")
                (skip-chars-backward " \t\n\f")
                t)
               ((and (not (bobp))
                     (= (char-before) ?\/)
                     (= (char-before (1- (point))) ?\*))
                (goto-char (- (point) 2))
                t)  ; Let nth 4 state handle the rest
               ((and (not (bobp))
                     ;;(verilog-looking-back "\\*)" nil) ;; super slow, use two char-before instead
                     (= (char-before) ?\))
                     (= (char-before (1- (point))) ?\*)
                     (not (verilog-looking-back "(\\s-*\\*)" nil))) ;; slow but unlikely to be called
                (goto-char (- (point) 2))
                (if (search-backward "(*" nil t)
                    (progn
                      (skip-chars-backward " \t\n\f")
                      t)
                  (progn
                    (goto-char (+ (point) 2))
                    nil)))
               (t
                (/= (skip-chars-backward " \t\n\f") 0))))))))