Commit d17b4804 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Improving the multiline regexes, making the one with single quotes work again.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4863 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 12 additions and 4 deletions
+12 -4
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
* src/nano.h, src/color.c, src/global.c, src/rcfile.c: Rename struct * src/nano.h, src/color.c, src/global.c, src/rcfile.c: Rename struct
type 'exttype' to 'regexlisttype', to better match its functions, and type 'exttype' to 'regexlisttype', to better match its functions, and
upon exit also free the regexes for libmagic results and headerlines. upon exit also free the regexes for libmagic results and headerlines.
* doc/syntax/python.nanorc: Improve the multiline regexes, make the
one with single quotes work again, and add some comments.
2014-05-10 Chris Allegretta <chrisa@asty.org> 2014-05-10 Chris Allegretta <chrisa@asty.org>
* src/rcfile.c (parse_color_names): Redefine false and true to * src/rcfile.c (parse_color_names): Redefine false and true to
......
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
## ##
syntax "python" "\.py$" syntax "python" "\.py$"
header "^#!.*/python[-0-9._]*" header "^#!.*/python[-0-9._]*"
# Function definitions.
icolor brightblue "def [0-9A-Z_]+" icolor brightblue "def [0-9A-Z_]+"
# Keywords.
color brightcyan "\<(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield)\>" color brightcyan "\<(and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|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}"
color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
color brightgreen start="\"\"\"[^"]" end="\"\"\"" # Multiline strings.
color brightgreen start="\'\'\'[^']" end="\'\'\'" color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(])\"\"\""
color brightred "#.*$" color brightgreen start="'''([^'),]|$)" end="(^|[^(])'''"
# Comments.
color brightred "(^|[[:blank:]])#.*$"
## Trailing whitespace # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment