Function: cperl-forward-group-in-re
cperl-forward-group-in-re is a byte-compiled function defined in
cperl-mode.el.gz.
Signature
(cperl-forward-group-in-re &optional ST-L)
Documentation
Find the end of a group in a REx.
Return the error message (if any). Does not work if delimiter is ).
Works before syntax recognition is done.
ST-L is a cached syntax table to use.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cperl-mode.el.gz
(defun cperl-forward-group-in-re (&optional st-l)
"Find the end of a group in a REx.
Return the error message (if any). Does not work if delimiter is `)'.
Works before syntax recognition is done.
ST-L is a cached syntax table to use."
;; Works *before* syntax recognition is done
(or st-l (setq st-l (list nil))) ; Avoid overwriting '()
(let (st result reset-st)
(condition-case err
(progn
(setq st (cperl-cached-syntax-table st-l))
(modify-syntax-entry ?\( "()" st)
(modify-syntax-entry ?\) ")(" st)
(setq reset-st (syntax-table))
(set-syntax-table st)
(forward-sexp 1))
(error (setq result err)))
;; now restore the initial state
(if st
(progn
(modify-syntax-entry ?\( "." st)
(modify-syntax-entry ?\) "." st)))
(if reset-st
(set-syntax-table reset-st))
result))