aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorMichael Albinus2017-04-02 11:03:14 +0200
committerMichael Albinus2017-04-02 11:03:14 +0200
commit40a33a3cb711f894ac61691c03cc13e58bc38145 (patch)
tree27fcb032eb04a20bd57b412b2120d357f28ab7fa /lisp/progmodes
parent59191cd0cbe8463f9095a71cb4048bb138d6e446 (diff)
parenta184a7edc58e1e053aa317a0f162df7e225597e1 (diff)
downloademacs-40a33a3cb711f894ac61691c03cc13e58bc38145.tar.gz
emacs-40a33a3cb711f894ac61691c03cc13e58bc38145.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/js.el13
-rw-r--r--lisp/progmodes/perl-mode.el8
2 files changed, 12 insertions, 9 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 /.../.
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index a516f07e72f..b75f32ee200 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -255,9 +255,11 @@
255 ;; format statements 255 ;; format statements
256 ("^[ \t]*format.*=[ \t]*\\(\n\\)" 256 ("^[ \t]*format.*=[ \t]*\\(\n\\)"
257 (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) 257 (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end))))
258 ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. 258 ;; Propertize perl prototype chars `$%&*;+@\[]' as punctuation
259 ;; Be careful not to match "sub { (...) ... }". 259 ;; in `sub' arg-specs like `sub myfun ($)' and `sub ($)'. But
260 ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))" 260 ;; don't match subroutine signatures like `sub add ($a, $b)', or
261 ;; anonymous subs like "sub { (...) ... }".
262 ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([][$%&*;+@\\]+\\))"
261 (1 ".")) 263 (1 "."))
262 ;; Turn __DATA__ trailer into a comment. 264 ;; Turn __DATA__ trailer into a comment.
263 ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)" 265 ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)"