emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9112315: CC Mode: Correct some incorrect regular ex


From: Alan Mackenzie
Subject: [Emacs-diffs] master 9112315: CC Mode: Correct some incorrect regular expressions:
Date: Sat, 9 Mar 2019 12:44:49 -0500 (EST)

branch: master
commit 911231545f57cf659deddb69950f005f948d8329
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    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): "|"
    -> "\\|".
---
 lisp/progmodes/cc-awk.el  | 4 ++--
 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 70b1237..70aa3c4 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 1b52709..4e63bd9 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]