Skip to content

Commit

Permalink
More fixes for triple-quoted string syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Oct 7, 2012
1 parent d151335 commit aff8a7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python.el
Expand Up @@ -170,7 +170,7 @@
;; First avoid a sequence preceded by an odd number of backslashes.
(syntax-propertize-rules
(;; ¡Backrefs don't work in syntax-propertize-rules!
(concat "\\(?:\\([RUru]\\)[Rr]?\\|^\\|[^\\]\\(?:\\\\.\\)*\\)?" ;Prefix.
(concat "\\(?:\\([RUru]\\)[Rr]?\\|\\(?:\\=\\|[^\\]\\)\\(?:\\\\.\\)*\\)?" ;Prefix.
"\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)")
(3 (ignore (python-quote-syntax))))
;; This doesn't really help.
Expand Down
4 changes: 3 additions & 1 deletion t/test_python.el
Expand Up @@ -9,4 +9,6 @@
(should-not (nth 3 (syntax-ppss 44)))
(should-not (nth 3 (syntax-ppss 52)))
(should-not (nth 3 (syntax-ppss 64)))
(should-not (nth 3 (syntax-ppss 105)))))
(should-not (nth 3 (syntax-ppss 105)))
(should-not (nth 3 (syntax-ppss 122)))
(should-not (nth 3 (syntax-ppss 140)))))
2 changes: 2 additions & 0 deletions t/tqstr.py
Expand Up @@ -5,3 +5,5 @@

# empty triple quoted string
"""""" x
''''''"""""" x
u""""""'''''' x

0 comments on commit aff8a7c

Please sign in to comment.