]> git.eshelyaron.com Git - emacs.git/commit
js-syntax-propertize: Disambiguate JS from JSX, fixing some indents
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Mon, 11 Feb 2019 11:00:34 +0000 (03:00 -0800)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 9 Apr 2019 05:48:21 +0000 (22:48 -0700)
commitbe86ece42cbb6204480c794d018b02fbda74689b
treea4734ce3c80cfc605851c11c320f544135c4d968
parent27e9bce77db54464737aa5be1ce7142b55f25952
js-syntax-propertize: Disambiguate JS from JSX, fixing some indents

Fix some JSX indentation bugs:

- Bug#24896 / https://github.com/mooz/js2-mode/issues/389
- Bug#30225
- https://github.com/mooz/js2-mode/issues/459

* lisp/progmodes/js.el (js--dotted-captured-name-re)
(js--unary-keyword-re, js--unary-keyword-p)
(js--disambiguate-beginning-of-jsx-tag)
(js--disambiguate-end-of-jsx-tag)
(js--disambiguate-js-from-jsx): New variables and functions.

(js-syntax-propertize): Additionally clarify when syntax is JS so that
‘(with-syntax-table sgml-mode-syntax-table …)’ does not mistake some
JS punctuation syntax for SGML parenthesis syntax, namely ‘<’ and ‘>’.

* test/manual/indent/js-jsx-unclosed-2.js: Add additional test for
unary operator parsing.
lisp/progmodes/js.el
test/manual/indent/js-jsx-unclosed-2.js