Skip to content

Commit 9317e3a

Browse files
committed
Highlight __defaults__, __kwdefaults__, __self__ and __func__
1 parent 9659a5b commit 9317e3a

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

grammars/MagicPython.cson

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,9 +1627,11 @@ repository:
16271627
(?x)
16281628
(\\.)?\\b(
16291629
__(?:
1630-
all | bases | class | code | debug | dict | doc | file | members
1631-
| metaclass | methods | module | mro | name | qualname | signature
1632-
| slots | subclasses | version | weakref | wrapped
1630+
all | bases | class | code | debug | defaults | dict
1631+
| doc | file | func | kwdefaults | members
1632+
| metaclass | methods | module | mro | name
1633+
| qualname | self | signature | slots | subclasses
1634+
| version | weakref | wrapped
16331635
)__
16341636
)\\b
16351637

grammars/MagicPython.tmLanguage

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,9 +2561,11 @@ indirectly through syntactic constructs
25612561
<string>(?x)
25622562
(\.)?\b(
25632563
__(?:
2564-
all | bases | class | code | debug | dict | doc | file | members
2565-
| metaclass | methods | module | mro | name | qualname | signature
2566-
| slots | subclasses | version | weakref | wrapped
2564+
all | bases | class | code | debug | defaults | dict
2565+
| doc | file | func | kwdefaults | members
2566+
| metaclass | methods | module | mro | name
2567+
| qualname | self | signature | slots | subclasses
2568+
| version | weakref | wrapped
25672569
)__
25682570
)\b
25692571
</string>

grammars/src/MagicPython.syntax.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,9 +1107,11 @@ repository:
11071107
(?x)
11081108
(\.)?\b(
11091109
__(?:
1110-
all | bases | class | code | debug | dict | doc | file | members
1111-
| metaclass | methods | module | mro | name | qualname | signature
1112-
| slots | subclasses | version | weakref | wrapped
1110+
all | bases | class | code | debug | defaults | dict
1111+
| doc | file | func | kwdefaults | members
1112+
| metaclass | methods | module | mro | name
1113+
| qualname | self | signature | slots | subclasses
1114+
| version | weakref | wrapped
11131115
)__
11141116
)\b
11151117
captures:

test/builtins/builtins3.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
some.__code__
2020
some.__wrapped__
2121
some.__signature__
22+
some.__defaults__
23+
some.__func__
24+
some.__self__
25+
some.__kwdefaults__
2226
some.__notspecial__
2327

2428

@@ -99,5 +103,17 @@
99103
__signature__ : source.python, support.variable.magic.python
100104
some : source.python
101105
. : source.python
106+
__defaults__ : source.python, support.variable.magic.python
107+
some : source.python
108+
. : source.python
109+
__func__ : source.python, support.variable.magic.python
110+
some : source.python
111+
. : source.python
112+
__self__ : source.python, support.variable.magic.python
113+
some : source.python
114+
. : source.python
115+
__kwdefaults__ : source.python, support.variable.magic.python
116+
some : source.python
117+
. : source.python
102118
__notspecial__ : source.python
103119
: source.python

0 commit comments

Comments
 (0)