Variable: js-jsx--font-lock-keywords

js-jsx--font-lock-keywords is a variable defined in js.el.gz.

Value

((js-jsx--match-tag-name 0 font-lock-function-name-face t)
 (js-jsx--match-attribute-name 0 font-lock-variable-name-face t)
 (js-jsx--match-text 0 'default t) (js-jsx--match-tag-beg)
 (js-jsx--match-tag-end) (js-jsx--match-expr))

Documentation

JSX font lock faces and multiline text properties.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
;; It wouldn’t be sufficient to font-lock JSX with mere regexps, since
;; a JSXElement may be nested inside a JS expression within the
;; boundaries of a parent JSXOpeningElement, and such a hierarchy
;; ought to be fontified like JSX, JS, and JSX respectively:
;;
;;   <div attr={void(<div></div>) && void(0)}></div>
;;
;;   <div attr={           ← JSX
;;          void(          ← JS
;;            <div></div>  ← JSX
;;          ) && void(0)   ← JS
;;        }></div>         ← JSX
;;
;; `js-syntax-propertize' unambiguously identifies JSX syntax,
;; including when it’s nested.
;;
;; Using a matcher function for each relevant part, retrieve match
;; data recorded as syntax properties for fontification.

(defconst js-jsx--font-lock-keywords
  `((js-jsx--match-tag-name 0 font-lock-function-name-face t)
    (js-jsx--match-attribute-name 0 font-lock-variable-name-face t)
    (js-jsx--match-text 0 'default t) ; “Undo” keyword fontification.
    (js-jsx--match-tag-beg)
    (js-jsx--match-tag-end)
    (js-jsx--match-expr))
  "JSX font lock faces and multiline text properties.")