]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/python.el
Merge from emacs-23
[gnu-emacs] / lisp / progmodes / python.el
index e72b18afd6101ab3df43d543daa37aade48ece6c..d2bb82e0580a6aa0333af332c35064852d3e5616 100644 (file)
   ;; string delimiters.  Fixme: Is there a better way?
   ;; First avoid a sequence preceded by an odd number of backslashes.
   (syntax-propertize-rules
-   (;; (rx (not (any ?\\))
-    ;;     ?\\ (* (and ?\\ ?\\))
-    ;;     (group (syntax string-quote))
-    ;;     (backref 1)
-    ;;     (group (backref 1)))
-    ;; ¡Backrefs don't work in syntax-propertize-rules!
-    "[^\\]\\\\\\(\\\\\\\\\\)*\\(?:''\\('\\)\\|\"\"\\(?2:\"\\)\\)"
-    (2 "\""))                           ; dummy
-   (;; (rx (optional (group (any "uUrR"))) ; prefix gets syntax property
-    ;;     (optional (any "rR"))           ; possible second prefix
-    ;;     (group (syntax string-quote))   ; maybe gets property
-    ;;     (backref 2)                     ; per first quote
-    ;;     (group (backref 2)))            ; maybe gets property
-    ;; ¡Backrefs don't work in syntax-propertize-rules!
-    "\\([RUru]\\)?[Rr]?\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)"
+   (;; ¡Backrefs don't work in syntax-propertize-rules!
+    (concat "\\(?:\\([RUru]\\)[Rr]?\\|^\\|[^\\]\\(?:\\\\.\\)*\\)" ;Prefix.
+              "\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)")
     (3 (ignore (python-quote-syntax))))
    ;; This doesn't really help.
    ;;((rx (and ?\\ (group ?\n))) (1 " "))