Home Download Buy Blog Forum Support

Syntax highlighting borks on a certain Python regex

Syntax highlighting borks on a certain Python regex

Postby FooBarWidget on Sun Jan 15, 2012 3:28 pm

Sublime Text 2's Python syntax highlighting borks on the following code:
Code: Select all
reo = re.compile(r'(?msu)(^|.)(\[(?P<attrlist>[^[\]]+?)\])?' \
        + r'(?:' + re.escape(lq) + r')' \
        + r'(?P<content>.+?)(?:'+re.escape(rq)+r')')

print "this is some code with wrong syntax highlighting"
print "the problems continue until the end of the document"

You can see that it thinks the regexp never ends and highlights the rest of the document as part of the regexp.

This code is a snippet from asciidoc.py. The problem screws up the highlighting in 70% of the file.

Please fix the syntax highlighting. I'm on Sublime Text 2 build 2165 on OS X Snow Leopard. TextMate has the same problem, so I'm guessing you're just reusing the TextMate syntax file.
FooBarWidget
 
Posts: 2
Joined: Sun Jan 15, 2012 3:17 pm

Re: Syntax highlighting borks on a certain Python regex

Postby FooBarWidget on Tue Jan 29, 2013 9:24 am

I'm still experiencing this problem on version 2.0.1, build 2217.
FooBarWidget
 
Posts: 2
Joined: Sun Jan 15, 2012 3:17 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 23 guests