nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Re: sample Python regexes, revisited


From: David Lawrence Ramsey
Subject: [Nano-devel] Re: sample Python regexes, revisited
Date: Fri, 31 Mar 2006 11:44:05 -0500
User-agent: Thunderbird 1.5 (X11/20051201)

John M. Gabriele wrote:

<snip>

> Ok. Dunno if this will help you, but here's some info.

This is very helpful.  See below.

<snip>

> I copy/pasted your Python syntax highlight commands (above)
> at the end of my ~/.nanorc, but when I start it, it tells
> me:

<snip>

> So default line-wrapping seems to be a pain for setting
> up your .nanorc. ;) So, I uncommented "set nowrap" and
> got rid of the extra newline in there.

Obviously, I should have sent it as an attachment instead of as part of
the email. ;)

I've made another attempt, and checked it with some other python files,
and I think I've gotten it (mostly) right this time.  It won't color
triple-quoted strings like

"""
this is a string
"""

properly, but all the regexes that do color them properly highlight far
too much, just as the current regex does. The new attempt is attached. Please let me know if it's acceptable. (And, if it is, could you please
also tell me who you got the original regexes from, so that if it's
merged into nanorc.sample, I know who to credit in the changelog for the
original work?)  Thanks in advance.

syntax "python" "\.py$"
icolor brightblue "def [A-Z_0-9]+"
color brightcyan 
"\<(and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|map|not|or|pass|print|raise|return|try|while)\>"
color brightgreen "(["']).*[^\\]\1" "(["']){3}.*[^\\]\1"
color brightgreen start=""""[^"]" end=""""" start="'''[^']" end="'''"
color brightred "#.*$"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]