Function: perl-font-lock-syntactic-face-function

perl-font-lock-syntactic-face-function is a byte-compiled function defined in perl-mode.el.gz.

Signature

(perl-font-lock-syntactic-face-function STATE)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/perl-mode.el.gz
(defun perl-font-lock-syntactic-face-function (state)
  (cond
   ((and (eq 2 (nth 7 state)) ; c-style comment
         (cdr-safe (get-text-property (nth 8 state) 'syntax-table))) ; HERE doc
    'perl-heredoc)
   ((and (nth 3 state)
         (eq ?e (cdr-safe (get-text-property (nth 8 state) 'syntax-table)))
         ;; This is a second-arg of s{..}{...} form; let's check if this second
         ;; arg is executable code rather than a string.  For that, we need to
         ;; look for an "e" after this second arg, so we have to hunt for the
         ;; end of the arg.  Depending on whether the whole arg has already
         ;; been syntax-propertized or not, the end-char will have different
         ;; syntaxes, so let's ignore syntax-properties temporarily so we can
         ;; pretend it has not been syntax-propertized yet.
         (let* ((parse-sexp-lookup-properties nil)
                (char (char-after (nth 8 state)))
                (paired (assq char perl-quote-like-pairs)))
           (with-syntax-table (perl-quote-syntax-table char)
             (save-excursion
               (if (not paired)
                   (parse-partial-sexp (point) (point-max)
                                       nil nil state 'syntax-table)
                 (condition-case nil
                     (progn
                       (goto-char (1+ (nth 8 state)))
                       (up-list 1))
                   (scan-error (goto-char (point-max)))))
               (put-text-property (nth 8 state) (point)
                                  'jit-lock-defer-multiline t)
               (looking-at "[ \t]*\\sw*e")))))
    nil)
   (t (funcall (default-value 'font-lock-syntactic-face-function) state))))