Parcourir la source

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

Victor Salgado il y a 11 ans
Parent
révision
9dc6765ad1
2 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 1
    1
      syntax/python.vim
  2. 1
    0
      test.py

+ 1
- 1
syntax/python.vim Voir le fichier

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 Voir le fichier

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