Your message dated Mon, 24 Nov 2008 00:17:15 -0500
with message-id <[EMAIL PROTECTED]>
has caused the   report #504510,
regarding Python decorators not highlighted correctly
to be marked as having been forwarded to the upstream software
author(s) Neil Schemenauer <[EMAIL PROTECTED]>

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
504510: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504510
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Neil,

The current Python syntax file requires that only function names follow
the @ of a decorator.  This isn't quite correct.  As per Python's
language reference[0], decorators are actually "dotted_names" instead of
just "identifiers".

Attached patch fixes the issue.

[0] - http://docs.python.org/reference/compound_stmts.html#function-definitions
-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim
index 5288d9b..d285aae 100644
--- a/runtime/syntax/python.vim
+++ b/runtime/syntax/python.vim
@@ -54,7 +54,8 @@ syn match   pythonComment	"#.*$" contains=pythonTodo,@Spell
 syn keyword pythonTodo		TODO FIXME XXX contained
 
 " Decorators (new in Python 2.4)
-syn match   pythonDecorator	"@" display nextgroup=pythonFunction skipwhite
+syn match   pythonDecoratorName	"[[:alpha:]_][[:alnum:]_]*\%(\.[[:alpha:]_][[:alnum:]_]*\)\="
+syn match   pythonDecorator	"@" display nextgroup=pythonDecoratorName skipwhite
 
 " strings
 syn region pythonString		matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape,@Spell
@@ -150,6 +151,7 @@ if version >= 508 || !exists("did_python_syn_inits")
   " The default methods for highlighting.  Can be overridden later
   HiLink pythonStatement	Statement
   HiLink pythonFunction		Function
+  HiLink pythonDecoratorName	Function
   HiLink pythonConditional	Conditional
   HiLink pythonRepeat		Repeat
   HiLink pythonString		String

Attachment: signature.asc
Description: Digital signature


--- End Message ---

Reply via email to