]> git.wh0rd.org Git - nano.git/commitdiff
Treating backslashed quotes properly, and
authorBenno Schulenberg <bensberg@justemail.net>
Wed, 2 Dec 2015 10:29:18 +0000 (10:29 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Wed, 2 Dec 2015 10:29:18 +0000 (10:29 +0000)
not colouring triple-quoted strings twice.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5467 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
doc/syntax/python.nanorc

index 0e91ed63ff90fd52bb78b9f81777c9081eda8057..364700026c512fd858320342e02030a7fc803bc6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-12-02  Benno Schulenberg  <bensberg@justemail.net>
        * doc/syntax/python.nanorc: Don't colour triple quotes by themselves.
+       * doc/syntax/python.nanorc: Treat backslashed quotes properly, and
+       don't colour triple-quoted strings in two manners.
 
 2015-12-02  Arturo Borrero Gonzalez  <arturo.borrero.glez@gmail.com>
        * doc/syntax/nftables.nanorc: New file; syntax colouring for nftables.
index 9662a5800097ab74f3053f8f9e0c247ca094eeea..5c35f3b677feb6237f06d3c0f25cd66a6a2c9ad6 100644 (file)
@@ -10,14 +10,14 @@ icolor brightblue "def [0-9A-Z_]+"
 color brightcyan "\<(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from)\>"
 color brightcyan "\<(global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\>"
 
-# Strings.
-color brightgreen "['][^']*[^'\\][']" "[']{3}.*[^'\\][']{3}"
-color brightgreen "["][^"]*[^"\\]["]" "["]{3}.*[^"\\]["]{3}"
+# Single-quoted strings.
+color brightgreen "'([^'\]|\\.)+'"
+color brightgreen ""([^"\]|\\.)+""
 # Comments.
 color brightred "(^|[[:blank:]])#.*$"
-# Multiline strings.
-color brightgreen start="\"\"\"[^"),]" end="(^|[^(])\"\"\""
-color brightgreen    start="'''[^'),]" end="(^|[^(])'''"
+# Triple-quoted strings.
+color brightgreen    start="'''[^'),]" end="(^|[^(\])'''"
+color brightgreen start="\"\"\"[^"),]" end="(^|[^(\])\"\"\""
 
 # Reminders.
 color ,yellow "(FIXME|TODO|XXX)"