]> git.eshelyaron.com Git - emacs.git/commit
Add basic JSX font-locking
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sun, 17 Feb 2019 08:38:01 +0000 (00:38 -0800)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 9 Apr 2019 05:48:21 +0000 (22:48 -0700)
commit52a3113b9beae6672c4bc981ee0c7bcc84ee58b5
tree8bf2e97587f88df0ff6f071ef241cf317380c13a
parent6f535762df1f8f55faa36878d4a2a0a8b112f666
Add basic JSX font-locking

Font-lock JSX from the beginning of the buffer to the end.  Tends to
break temporarily when editing lines, because the parser doesn’t yet
look backwards to determine if the end of a tag in the current range
starts before the range.

This also re-breaks some tests fixed by previous commits, as we begin
to take a different direction in our parsing code, looking for JSX,
rather than for non-JSX.  The parsing code will eventually provide
information for indentation again.

* lisp/progmodes/js.el (js--dotted-captured-name-re)
(js-jsx--disambiguate-beginning-of-tag)
(js-jsx--disambiguate-end-of-tag, js-jsx--disambiguate-syntax):
Remove.
(js-jsx--font-lock-keywords): New variable.
(js--font-lock-keywords-3): Add JSX matchers.
(js-jsx--match-tag-name, js-jsx--match-attribute-name): New functions.
(js-jsx--syntax-propertize-tag): New function to aid in JSX
font-locking and eventually indentation.
(js-jsx--text-properties): New variable.
(js-syntax-propertize): Propertize JSX properly using
syntax-propertize-rules.
lisp/progmodes/js.el