Permit non-ASCII identifiers in JS

* lisp/progmodes/js.el (js--name-start-re): Generally allow
identifiers to begin with non-ASCII letters.  This is of particular
importance to JSX parsing.

* test/manual/indent/jsx-unclosed-2.jsx: Add test to ensure non-ASCII
characters are parsed properly.
This commit is contained in:
Jackson Ray Hamilton 2019-04-08 08:36:38 -07:00
parent 3eadf1eff4
commit 18bbfc4c75
No known key found for this signature in database
GPG key ID: B4771664B476B290
2 changed files with 8 additions and 1 deletions

View file

@ -65,7 +65,7 @@
;;; Constants
(defconst js--name-start-re (concat "[a-zA-Z_$]")
(defconst js--name-start-re (concat "[[:alpha:]_$]")
"Regexp matching the start of a JavaScript identifier, without grouping.")
(defconst js--stmt-delim-chars "^;{}?:")

View file

@ -56,3 +56,10 @@ while (await foo > bar) void 0
/ >
< / div>
< / div >
// Non-ASCII identifiers are acceptable.
<Über>
<Québec διακριτικός sueño="">
Guten Tag!
</Québec>
</Über>