]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Correct some incorrect regular expressions:
authorAlan Mackenzie <acm@muc.de>
Sat, 9 Mar 2019 17:41:11 +0000 (17:41 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 9 Mar 2019 17:41:11 +0000 (17:41 +0000)
* 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): "|"
-> "\\|".

lisp/progmodes/cc-awk.el
lisp/progmodes/cc-mode.el

index 70b1237cb8dd5ffc6c41a315925b459bed488769..70aa3c4b1f12ff4e0eb9852df2c88d4ebdcb8833 100644 (file)
   "\\[:[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.
index 1b527094caa4035e0130ef6c87725e2e0d096f04..4e63bd9144b89aa1ea5fa84983f89b9fd19b99db 100644 (file)
@@ -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))