Browse Source

Fix decorators to allow the same kind of characters that functions do

Victor Salgado 9 years ago
parent
commit
9dc6765ad1
2 changed files with 2 additions and 1 deletions
  1. 1
    1
      syntax/python.vim
  2. 1
    0
      test.py

+ 1
- 1
syntax/python.vim View File

179
 "
179
 "
180
 
180
 
181
 syn match   pythonDecorator	"@" display nextgroup=pythonDottedName skipwhite
181
 syn match   pythonDecorator	"@" display nextgroup=pythonDottedName skipwhite
182
-syn match   pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\%(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
182
+syn match   pythonDottedName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\)*" display contained
183
 syn match   pythonDot        "\." display containedin=pythonDottedName
183
 syn match   pythonDot        "\." display containedin=pythonDottedName
184
 
184
 
185
 "
185
 "

+ 1
- 0
test.py View File

51
 
51
 
52
 @ decoratorname
52
 @ decoratorname
53
 @ object.__init__(arg1, arg2)
53
 @ object.__init__(arg1, arg2)
54
+@ декоратор.décorateur
54
 
55
 
55
 # Numbers
56
 # Numbers
56
 
57