emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] feature/jsx f046d6e 2/2: Permit non-ASCII identifiers in J


From: Jackson Ray Hamilton
Subject: [Emacs-diffs] feature/jsx f046d6e 2/2: Permit non-ASCII identifiers in JS
Date: Mon, 8 Apr 2019 11:42:06 -0400 (EDT)

branch: feature/jsx
commit f046d6e9d2b74cade3712571525da3e62592eaf7
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    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.
---
 lisp/progmodes/js.el                  | 2 +-
 test/manual/indent/jsx-unclosed-2.jsx | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index b1068bf..9185371 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -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 "^;{}?:")
diff --git a/test/manual/indent/jsx-unclosed-2.jsx 
b/test/manual/indent/jsx-unclosed-2.jsx
index be0a605..fb665b9 100644
--- a/test/manual/indent/jsx-unclosed-2.jsx
+++ b/test/manual/indent/jsx-unclosed-2.jsx
@@ -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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]