comparison lisp/progmodes/python.el @ 111449:132f2dfd549f

Merge from emacs-23
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 09 Nov 2010 15:07:10 -0500
parents 249a1455856a 85a2b871f225
children bd93bfc2fc83
comparison
equal deleted inserted replaced
111448:321fbae3e04d 111449:132f2dfd549f
169 (defconst python-syntax-propertize-function 169 (defconst python-syntax-propertize-function
170 ;; Make outer chars of matching triple-quote sequences into generic 170 ;; Make outer chars of matching triple-quote sequences into generic
171 ;; string delimiters. Fixme: Is there a better way? 171 ;; string delimiters. Fixme: Is there a better way?
172 ;; First avoid a sequence preceded by an odd number of backslashes. 172 ;; First avoid a sequence preceded by an odd number of backslashes.
173 (syntax-propertize-rules 173 (syntax-propertize-rules
174 (;; (rx (not (any ?\\)) 174 (;; ĦBackrefs don't work in syntax-propertize-rules!
175 ;; ?\\ (* (and ?\\ ?\\)) 175 (concat "\\(?:\\([RUru]\\)[Rr]?\\|^\\|[^\\]\\(?:\\\\.\\)*\\)" ;Prefix.
176 ;; (group (syntax string-quote)) 176 "\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)")
177 ;; (backref 1)
178 ;; (group (backref 1)))
179 ;; ĦBackrefs don't work in syntax-propertize-rules!
180 "[^\\]\\\\\\(\\\\\\\\\\)*\\(?:''\\('\\)\\|\"\"\\(?2:\"\\)\\)"
181 (2 "\"")) ; dummy
182 (;; (rx (optional (group (any "uUrR"))) ; prefix gets syntax property
183 ;; (optional (any "rR")) ; possible second prefix
184 ;; (group (syntax string-quote)) ; maybe gets property
185 ;; (backref 2) ; per first quote
186 ;; (group (backref 2))) ; maybe gets property
187 ;; ĦBackrefs don't work in syntax-propertize-rules!
188 "\\([RUru]\\)?[Rr]?\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)"
189 (3 (ignore (python-quote-syntax)))) 177 (3 (ignore (python-quote-syntax))))
190 ;; This doesn't really help. 178 ;; This doesn't really help.
191 ;;((rx (and ?\\ (group ?\n))) (1 " ")) 179 ;;((rx (and ?\\ (group ?\n))) (1 " "))
192 )) 180 ))
193 181