]> git.eshelyaron.com Git - emacs.git/commitdiff
Permit non-ASCII identifiers in JS
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Mon, 8 Apr 2019 15:36:38 +0000 (08:36 -0700)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 9 Apr 2019 05:48:24 +0000 (22:48 -0700)
* 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.

lisp/progmodes/js.el
test/manual/indent/jsx-unclosed-2.jsx

index b1068bfc7b8e22454bb5cc18f114a401ad775d8e..9185371b523a7a96f3e28a543d7e2e2cd8a09502 100644 (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 "^;{}?:")
index be0a605503feac2fbcdccb93b143034962ad0f0a..fb665b96a43aa6afd47ce2f11717b19c1c8f58ba 100644 (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>