Function: opascal-literal-kind

opascal-literal-kind is a byte-compiled function defined in opascal.el.gz.

Signature

(opascal-literal-kind P)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/opascal.el.gz
(defun opascal-literal-kind (p)
  ;; Returns the literal kind the point p is in (or nil if not in a literal).
  (when (and (<= (point-min) p) (<= p (point-max)))
    (save-excursion
      (let ((ppss (syntax-ppss p)))
        ;; We want to return non-nil when right in front
        ;; of a comment/string.
        (if (null (nth 8 ppss))
            (when (looking-at opascal--literal-start-re)
              (pcase (char-after)
                (?/  'comment-single-line)
                (?\{ 'comment-multi-line-1)
                (?\( 'comment-multi-line-2)
                (?\' 'string)
                (?\" 'double-quoted-string)))
          (if (nth 3 ppss)   ;String.
              (if (eq (nth 3 ppss) ?\")
                  'double-quoted-string 'string)
            (pcase (nth 7 ppss)
              (2 'comment-single-line)
              (1 'comment-multi-line-2)
              (_  'comment-multi-line-1))))))))