diff options
| author | Alan Mackenzie | 2019-03-09 17:41:11 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2019-03-09 17:41:11 +0000 |
| commit | 911231545f57cf659deddb69950f005f948d8329 (patch) | |
| tree | 10d4872af8b8ff1498d63dda6a377829a4b4e645 | |
| parent | 21f54feee8c83e2c5fd8eeb6741cbd479a7b19eb (diff) | |
| download | emacs-911231545f57cf659deddb69950f005f948d8329.tar.gz emacs-911231545f57cf659deddb69950f005f948d8329.zip | |
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 @@ | |||
| 188 | "\\[:[a-z]+:\\]") | 188 | "\\[:[a-z]+:\\]") |
| 189 | ;; Matches a character class spec (e.g. [:alpha:]). | 189 | ;; Matches a character class spec (e.g. [:alpha:]). |
| 190 | (defconst c-awk-regexp-char-list-re | 190 | (defconst c-awk-regexp-char-list-re |
| 191 | (concat "\\[" c-awk-escaped-newlines*-re "^?" c-awk-escaped-newlines*-re "]?" | 191 | (concat "\\[\\(" c-awk-escaped-newlines*-re "\\^\\)?" c-awk-escaped-newlines*-re "]?" |
| 192 | "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re | 192 | "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re |
| 193 | "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) | 193 | "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) |
| 194 | ;; Matches a regexp char list, up to (but not including) EOL if the ] is | 194 | ;; Matches a regexp char list, up to (but not including) EOL if the ] is |
| 195 | ;; missing. | 195 | ;; 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." | |||
| 1349 | ;; We're at the start of a string. | 1349 | ;; We're at the start of a string. |
| 1350 | (memq (char-before) c-string-delims))) | 1350 | (memq (char-before) c-string-delims))) |
| 1351 | (if (c-unescaped-nls-in-string-p (1- (point))) | 1351 | (if (c-unescaped-nls-in-string-p (1- (point))) |
| 1352 | (looking-at "\\(\\\\\\(.\\|\n|\r\\)\\|[^\"]\\)*") | 1352 | (looking-at "\\(\\\\\\(.\\|\n\\|\r\\)\\|[^\"]\\)*") |
| 1353 | (looking-at (cdr (assq (char-before) c-string-innards-re-alist)))) | 1353 | (looking-at (cdr (assq (char-before) c-string-innards-re-alist)))) |
| 1354 | (cond | 1354 | (cond |
| 1355 | ((memq (char-after (match-end 0)) '(?\n ?\r)) | 1355 | ((memq (char-after (match-end 0)) '(?\n ?\r)) |