diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/js.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index aed42a85076..3c720c05610 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -1713,7 +1713,7 @@ This performs fontification according to `js--class-styles'." | |||
| 1713 | (not (any ?\] ?\\)) | 1713 | (not (any ?\] ?\\)) |
| 1714 | (and "\\" not-newline))) | 1714 | (and "\\" not-newline))) |
| 1715 | "]"))) | 1715 | "]"))) |
| 1716 | (group "/")) | 1716 | (group (zero-or-one "/"))) |
| 1717 | "Regular expression matching a JavaScript regexp literal.") | 1717 | "Regular expression matching a JavaScript regexp literal.") |
| 1718 | 1718 | ||
| 1719 | (defun js-syntax-propertize-regexp (end) | 1719 | (defun js-syntax-propertize-regexp (end) |
| @@ -1721,12 +1721,13 @@ This performs fontification according to `js--class-styles'." | |||
| 1721 | (when (eq (nth 3 ppss) ?/) | 1721 | (when (eq (nth 3 ppss) ?/) |
| 1722 | ;; A /.../ regexp. | 1722 | ;; A /.../ regexp. |
| 1723 | (goto-char (nth 8 ppss)) | 1723 | (goto-char (nth 8 ppss)) |
| 1724 | (when (and (looking-at js--syntax-propertize-regexp-regexp) | 1724 | (when (looking-at js--syntax-propertize-regexp-regexp) |
| 1725 | ;; Don't touch text after END. | 1725 | ;; Don't touch text after END. |
| 1726 | (<= (match-end 1) end)) | 1726 | (when (> end (match-end 1)) |
| 1727 | (put-text-property (match-beginning 1) (match-end 1) | 1727 | (setq end (match-end 1))) |
| 1728 | (put-text-property (match-beginning 1) end | ||
| 1728 | 'syntax-table (string-to-syntax "\"/")) | 1729 | 'syntax-table (string-to-syntax "\"/")) |
| 1729 | (goto-char (match-end 0)))))) | 1730 | (goto-char end))))) |
| 1730 | 1731 | ||
| 1731 | (defun js-syntax-propertize (start end) | 1732 | (defun js-syntax-propertize (start end) |
| 1732 | ;; JavaScript allows immediate regular expression objects, written /.../. | 1733 | ;; JavaScript allows immediate regular expression objects, written /.../. |