diff options
author | Jackson Ray Hamilton <jackson@jacksonrayhamilton.com> | 2019-04-07 00:25:35 -0700 |
---|---|---|
committer | Jackson Ray Hamilton <jackson@jacksonrayhamilton.com> | 2019-04-08 22:48:24 -0700 |
commit | 7b2e3c60d081597adb7feaaabfee8cb8de62289b (patch) | |
tree | a4bfa97a66d402c69bb25c7889fa4c629376a031 /test/manual/indent | |
parent | 462baabed93228a00e5ccadbe5704fb317957cb7 (diff) | |
download | emacs-7b2e3c60d081597adb7feaaabfee8cb8de62289b.tar.gz emacs-7b2e3c60d081597adb7feaaabfee8cb8de62289b.tar.bz2 emacs-7b2e3c60d081597adb7feaaabfee8cb8de62289b.zip |
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.
Diffstat (limited to 'test/manual/indent')
-rw-r--r-- | test/manual/indent/jsx-unclosed-2.jsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/manual/indent/jsx-unclosed-2.jsx b/test/manual/indent/jsx-unclosed-2.jsx index 8db25aa67f1..9d80a2e9ae2 100644 --- a/test/manual/indent/jsx-unclosed-2.jsx +++ b/test/manual/indent/jsx-unclosed-2.jsx @@ -6,10 +6,15 @@ // The following tests go below any comments to avoid including // misindented comments among the erroring lines. -// Don’t misinterpret equality operators as JSX. +// Don’t misinterpret inequality operators as JSX. for (; i < length;) void 0 if (foo > bar) void 0 +// Don’t misintrepet inequalities within JSX, either. +<div> + {foo < bar} +</div> + // Don’t even misinterpret unary operators as JSX. if (foo < await bar) void 0 while (await foo > bar) void 0 |