diff options
| author | Tom Tromey | 2017-01-16 14:02:45 -0700 |
|---|---|---|
| committer | Tom Tromey | 2017-01-17 15:33:20 -0700 |
| commit | aa711e0a92c30914e1c68cf39251638d4faee22d (patch) | |
| tree | 0933e5bee8a5544e639854ea2f181cee3f2f9081 /lisp | |
| parent | 14c7d3a6e0581fd26254cd316fd369c9c3651146 (diff) | |
| download | emacs-aa711e0a92c30914e1c68cf39251638d4faee22d.tar.gz emacs-aa711e0a92c30914e1c68cf39251638d4faee22d.zip | |
Fix JS regexp literal syntax propertization in expressions
Bug#25465:
* lisp/progmodes/js.el (js-syntax-propertize): Recognize a regexp
literal after "!", "&", and "|".
test/lisp/progmodes/js-tests.el (js-mode-regexp-syntax): New test.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/js.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 54df3913fc6..2e5c6ae119b 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -1720,10 +1720,10 @@ This performs fontification according to `js--class-styles'." | |||
| 1720 | ;; Distinguish /-division from /-regexp chars (and from /-comment-starter). | 1720 | ;; Distinguish /-division from /-regexp chars (and from /-comment-starter). |
| 1721 | ;; FIXME: Allow regexps after infix ops like + ... | 1721 | ;; FIXME: Allow regexps after infix ops like + ... |
| 1722 | ;; https://developer.mozilla.org/en/JavaScript/Reference/Operators | 1722 | ;; https://developer.mozilla.org/en/JavaScript/Reference/Operators |
| 1723 | ;; We can probably just add +, -, !, <, >, %, ^, ~, |, &, ?, : at which | 1723 | ;; We can probably just add +, -, <, >, %, ^, ~, ?, : at which |
| 1724 | ;; point I think only * and / would be missing which could also be added, | 1724 | ;; point I think only * and / would be missing which could also be added, |
| 1725 | ;; but need care to avoid affecting the // and */ comment markers. | 1725 | ;; but need care to avoid affecting the // and */ comment markers. |
| 1726 | ("\\(?:^\\|[=([{,:;]\\|\\_<return\\_>\\)\\(?:[ \t]\\)*\\(/\\)[^/*]" | 1726 | ("\\(?:^\\|[=([{,:;|&!]\\|\\_<return\\_>\\)\\(?:[ \t]\\)*\\(/\\)[^/*]" |
| 1727 | (1 (ignore | 1727 | (1 (ignore |
| 1728 | (forward-char -1) | 1728 | (forward-char -1) |
| 1729 | (when (or (not (memq (char-after (match-beginning 0)) '(?\s ?\t))) | 1729 | (when (or (not (memq (char-after (match-beginning 0)) '(?\s ?\t))) |