diff options
author | Alan Mackenzie <acm@muc.de> | 2019-03-09 17:41:11 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2019-03-09 17:41:11 +0000 |
commit | 911231545f57cf659deddb69950f005f948d8329 (patch) | |
tree | 10d4872af8b8ff1498d63dda6a377829a4b4e645 | |
parent | 21f54feee8c83e2c5fd8eeb6741cbd479a7b19eb (diff) | |
download | emacs-911231545f57cf659deddb69950f005f948d8329.tar.gz |
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): "|"
-> "\\|".
-rw-r--r-- | lisp/progmodes/cc-awk.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/cc-mode.el | 2 |
2 files changed, 3 insertions, 3 deletions
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)) |