From: Alan Mackenzie Date: Sat, 9 Mar 2019 17:41:11 +0000 (+0000) Subject: CC Mode: Correct some incorrect regular expressions: X-Git-Tag: emacs-27.0.90~3447^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=911231545f57cf659deddb69950f005f948d8329;p=emacs.git CC Mode: Correct some incorrect regular expressions: * lisp/progmodes/cc-awk.el (c-awk-regexp-char-list-re): "^" -> "\\^". R*x?R* -> \(R*x\)?R*. * lisp/progmodes/cc-mode.el (c-after-change-re-mark-unbalanced-strings): "|" -> "\\|". --- diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index 70b1237cb8d..70aa3c4b1f1 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -188,8 +188,8 @@ "\\[:[a-z]+:\\]") ;; Matches a character class spec (e.g. [:alpha:]). (defconst c-awk-regexp-char-list-re - (concat "\\[" c-awk-escaped-newlines*-re "^?" c-awk-escaped-newlines*-re "]?" - "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re + (concat "\\[\\(" c-awk-escaped-newlines*-re "\\^\\)?" c-awk-escaped-newlines*-re "]?" + "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) ;; Matches a regexp char list, up to (but not including) EOL if the ] is ;; missing. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 1b527094caa..4e63bd9144b 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1349,7 +1349,7 @@ Note that the style variables are always made local to the buffer." ;; We're at the start of a string. (memq (char-before) c-string-delims))) (if (c-unescaped-nls-in-string-p (1- (point))) - (looking-at "\\(\\\\\\(.\\|\n|\r\\)\\|[^\"]\\)*") + (looking-at "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\"]\\)*") (looking-at (cdr (assq (char-before) c-string-innards-re-alist)))) (cond ((memq (char-after (match-end 0)) '(?\n ?\r))