Function: rainbow-delimiters--char-ineligible-p

rainbow-delimiters--char-ineligible-p is a byte-compiled function defined in rainbow-delimiters.el.

Signature

(rainbow-delimiters--char-ineligible-p LOC PPSS DELIM-SYNTAX-CODE)

Documentation

Return t if char at LOC should not be highlighted.

PPSS is the parse-partial-sexp state at LOC. DELIM-SYNTAX-CODE is the car of a raw syntax descriptor at LOC.

Returns t if char at loc meets one of the following conditions:
- Inside a string.
- Inside a comment.
- Is an escaped char, e.g. ?)

Source Code

;; Defined in ~/.emacs.d/elpa/rainbow-delimiters-20210515.1254/rainbow-delimiters.el
(defun rainbow-delimiters--char-ineligible-p (loc ppss delim-syntax-code)
  "Return t if char at LOC should not be highlighted.
PPSS is the `parse-partial-sexp' state at LOC.
DELIM-SYNTAX-CODE is the `car' of a raw syntax descriptor at LOC.

Returns t if char at loc meets one of the following conditions:
- Inside a string.
- Inside a comment.
- Is an escaped char, e.g. ?\)"
  (or
   (nth 3 ppss)                ; inside string?
   (nth 4 ppss)                ; inside comment?
   (nth 5 ppss)                ; escaped according to the syntax table?
   ;; Note: no need to consider single-char openers, they're already handled
   ;; by looking at ppss.
   (cond
    ;; Two character opener, LOC at the first character?
    ((/= 0 (logand #x10000 delim-syntax-code))
     (/= 0 (logand #x20000 (or (car (syntax-after (1+ loc))) 0))))
    ;; Two character opener, LOC at the second character?
    ((/= 0 (logand #x20000 delim-syntax-code))
     (/= 0 (logand #x10000 (or (car (syntax-after (1- loc))) 0))))
    (t
     nil))))