]> git.eshelyaron.com Git - emacs.git/commit
Improve whitespace and unary keyword parsing
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sun, 7 Apr 2019 21:36:47 +0000 (14:36 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 9 Apr 2019 05:48:24 +0000 (22:48 -0700)
commit7a9dac5c944432cc2329473bb1dd9db9c0bfdd99
treeb331864efe2500c8e73423398fb5197152028802
parent98e36a3e31da10bf230743d285544305f730b60d
Improve whitespace and unary keyword parsing

* lisp/progmodes/js.el (js--name-start-chars): Remove, adding these
chars back to js--name-start-re.
(js--name-start-re): Add chars back from js--name-start-chars.

(js-jsx--tag-start-re): Improve regexp to capture the tag name (so it
can be disambiguated from a unary keyword), to match newlines (which
are common in this spot), and to require at least one whitespace
character before the attribute name.

(js-jsx--matched-tag-type): Ensure the “tag name” isn’t possibly a
unary keyword.

(js-jsx--self-closing-re, js-jsx--matching-close-tag-pos): Allow
whitespace around “<” and “>”.

* test/manual/indent/jsx-unclosed-2.jsx: Add tests for unary keyword
and whitespace parsing.
lisp/progmodes/js.el
test/manual/indent/jsx-unclosed-2.jsx