[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 18bbfc4 25/28: Permit non-ASCII identifiers in JS
From: |
Jackson Ray Hamilton |
Subject: |
[Emacs-diffs] master 18bbfc4 25/28: Permit non-ASCII identifiers in JS |
Date: |
Tue, 9 Apr 2019 02:00:16 -0400 (EDT) |
branch: master
commit 18bbfc4c754ea653ee0a7e2e47d1d61304f5c42a
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>
- [Emacs-diffs] master be86ece 04/28: js-syntax-propertize: Disambiguate JS from JSX, fixing some indents, (continued)
- [Emacs-diffs] master be86ece 04/28: js-syntax-propertize: Disambiguate JS from JSX, fixing some indents, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master d9d1bb2 14/28: Rename tests to use the “.jsx” file extension, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 84b1cfb 15/28: Indent broken arrow function bodies as an N+1th arg, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 6f53576 05/28: Use js-jsx- prefix for functions and variables, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master bf37078 12/28: Automatically detect JSX in JavaScript files, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master cf416d9 28/28: Explain reasonings for JSX syntax support design decisions, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 9545519 26/28: Add open/close parenthesis syntax to “<” and “>” in JSX, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 7c3ffda 27/28: Move curly functions closer to where they’re used, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 1a1ef28 10/28: Indent JSX as parsed in a JS context, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 55c80d4 17/28: Indent expressions in JSXAttributes relative to the attribute’s name, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 18bbfc4 25/28: Permit non-ASCII identifiers in JS,
Jackson Ray Hamilton <=
- [Emacs-diffs] master 98e36a3 21/28: Optimize js-jsx--enclosing-tag-pos, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 7a9dac5 22/28: Improve whitespace and unary keyword parsing, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 8b92719 13/28: Improve JSX syntax propertization, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master afec451 18/28: Split JSX indentation calculation into several functions, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master e48306f 23/28: Properly set a dynamic, syntactic mode name, Jackson Ray Hamilton, 2019/04/09
- [Emacs-diffs] master 7b2e3c6 20/28: Optimize js-jsx--matching-close-tag-pos, Jackson Ray Hamilton, 2019/04/09