Function: web-mode-token-opening-paren-position
web-mode-token-opening-paren-position is a natively compiled function
defined in web-mode.el.
Signature
(web-mode-token-opening-paren-position POS LIMIT CONTEXT)
Source Code
;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-token-opening-paren-position (pos limit _context)
(save-restriction
(unless limit (setq limit nil))
(goto-char pos)
(let* ((n -1)
(paren (char-after))
(pairs '((?\) . "[)(]")
(?\] . "[\]\[]")
(?\} . "[}{]")
(?\> . "[><]")))
(regexp (cdr (assoc paren pairs)))
(continue (not (null regexp)))
(counter 0))
(while (and continue (re-search-backward regexp limit t))
(cond
((> (setq counter (1+ counter)) 200)
(message "token-opening-paren-position ** warning **")
(setq continue nil))
((get-text-property (point) 'block-side)
)
((eq (char-after) paren)
(setq n (1- n)))
(t
(setq n (1+ n))
(setq continue (not (= n 0))))
)
) ;while
(if (= n 0) (point) nil)
)))