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.
parent 3eadf1ef
......@@ -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 "^;{}?:")
......@@ -56,3 +56,10 @@ while (await foo > bar) void 0
/ >
< / div>
< / div >
// Non-ASCII identifiers are acceptable.
<Québec διακριτικός sueño="">
Guten Tag!
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment