Function: js--re-search-forward

js--re-search-forward is a byte-compiled function defined in js.el.gz.

Signature

(js--re-search-forward REGEXP &optional BOUND NOERROR COUNT)

Documentation

Search forward, ignoring strings, cpp macros, and comments.

This function invokes re-search-forward, but treats the buffer as if strings, cpp macros, and comments have been removed.

If invoked while inside a macro, it treats the contents of the macro as normal text.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
(defun js--re-search-forward (regexp &optional bound noerror count)
  "Search forward, ignoring strings, cpp macros, and comments.
This function invokes `re-search-forward', but treats the buffer
as if strings, cpp macros, and comments have been removed.

If invoked while inside a macro, it treats the contents of the
macro as normal text."
  (unless count (setq count 1))
  (let ((saved-point (point))
        (search-fun
         (cond ((< count 0) (setq count (- count))
                #'js--re-search-backward-inner)
               ((> count 0) #'js--re-search-forward-inner)
               (t #'ignore))))
    (condition-case err
        (funcall search-fun regexp bound count)
      (search-failed
       (goto-char saved-point)
       (unless noerror
         (signal (car err) (cdr err)))))))