]> git.eshelyaron.com Git - emacs.git/commit
Optimize js-jsx--matching-close-tag-pos
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Sun, 7 Apr 2019 07:25:35 +0000 (00:25 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 9 Apr 2019 05:48:24 +0000 (22:48 -0700)
commit7b2e3c60d081597adb7feaaabfee8cb8de62289b
treea4bfa97a66d402c69bb25c7889fa4c629376a031
parent462baabed93228a00e5ccadbe5704fb317957cb7
Optimize js-jsx--matching-close-tag-pos

This function’s performance was having a noticeable impact when
editing large JSX structures.  Improve its performance
slightly (elapsed time will be cut in half according to ELP).

* lisp/progmodes/js.el (js-jsx--tag-re): Remove.
(js-jsx--matched-tag-type): Simplify implementation with respect to
the new implementation of js-jsx--matching-close-tag-pos.
(js-jsx--self-closing-re): Simplify regexp slightly in sync with a
generally simpler matching algorithm.
(js-jsx--matching-close-tag-pos): Optimize matching algorithm by using
multiple simple regexp searches, rather than one big complex search.

* test/manual/indent/jsx-unclosed-2.jsx: Use the term “inequality” and
add a test for a possible parsing foible.
lisp/progmodes/js.el
test/manual/indent/jsx-unclosed-2.jsx