]> git.eshelyaron.com Git - emacs.git/commitdiff
Correct some slightly incorrect regular expressions:
authorAlan Mackenzie <acm@muc.de>
Sun, 3 Mar 2019 20:03:56 +0000 (20:03 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 3 Mar 2019 20:03:56 +0000 (20:03 +0000)
* lisp/progmodes/cc-awk.el (c-awk-harmless-char-re)
(c-awk-harmless-line-char-re, c-awk-_-harmless-nonws-char-re): [...\\\\...]
-> [...\\...].

* lisp/progmodes/cc-engine.el (c-literal-limits): "*/" -> "\\*/".

* lisp/progmodes/cc-mode.el (c-after-change-re-mark-unbalanced-strings):
"\\\r" -> "\r".

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

index bcb9d0430a3eecff71fb44bf8af3d9b3f5e78005..70b1237cb8dd5ffc6c41a315925b459bed488769 100644 (file)
 ;; REGEXPS FOR "HARMLESS" STRINGS/LINES.
 (defconst c-awk-harmless-_ "_\\([^\"]\\|\\'\\)")
 ;;   Matches an underline NOT followed by ".
-(defconst c-awk-harmless-char-re "[^_#/\"{}();\\\\\n\r]")
+(defconst c-awk-harmless-char-re "[^_#/\"{}();\\\n\r]")
 ;;   Matches any character not significant in the state machine applying
 ;; syntax-table properties to "s and /s.
 (defconst c-awk-harmless-string*-re
   (concat "\\=" c-awk-harmless-string*-re))
 ;; Matches the (possibly empty) sequence of "insignificant" chars at point.
 
-(defconst c-awk-harmless-line-char-re "[^_#/\"\\\\\n\r]")
+(defconst c-awk-harmless-line-char-re "[^_#/\"\\\n\r]")
 ;;   Matches any character but a _, #, /, ", \, or newline.  N.B. _" starts a
 ;; localization string in gawk 3.1
 (defconst c-awk-harmless-line-string*-re
 ;; which can precede an expression.
 
 ;; REGEXPS USED FOR FINDING THE POSITION OF A "virtual semicolon"
-(defconst c-awk-_-harmless-nonws-char-re "[^#/\"\\\\\n\r \t]")
+(defconst c-awk-_-harmless-nonws-char-re "[^#/\"\\\n\r \t]")
 (defconst c-awk-non-/-syn-ws*-re
   (concat
    "\\(" c-awk-escaped-nls*-with-space*
index 27ce3029c4a01d1e3e68634b0d77e75a1cc7f775..301d07c9c9cc879834052f8173b97c5733edeb79 100644 (file)
@@ -5118,7 +5118,7 @@ comment at the start of cc-engine.el for more info."
              (setq beg (c-safe (c-backward-sexp 1) (point))))
 
             ((and (c-safe (forward-char -2) t)
-                  (looking-at "*/"))
+                  (looking-at "\\*/"))
              ;; Block comment.  Due to the nature of line
              ;; comments, they will always be covered by the
              ;; normal case above.
index 6718813b79c26cf62e82f997f837f76b81a3f424..1b527094caa4035e0130ef6c87725e2e0d096f04 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))