Skip to content

Commit bff4e71

Browse files
committed
Scope 'super' with support.type.python
1 parent 77c10bf commit bff4e71

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

grammars/MagicPython.cson

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ repository:
14721472
| isinstance | issubclass | iter | len | license | locals | map
14731473
| max | memoryview | min | next | oct | open | ord | pow | print
14741474
| quit | range | reload | repr | reversed | round
1475-
| setattr | sorted | sum | super | vars | zip
1475+
| setattr | sorted | sum | vars | zip
14761476
)\\b
14771477
14781478
'''
@@ -1484,6 +1484,11 @@ repository:
14841484
bool | bytearray | bytes | classmethod | complex | dict
14851485
| float | frozenset | int | list | object | property
14861486
| set | slice | staticmethod | str | tuple | type
1487+
1488+
(?# Although 'super' is not a type, it's related to types,
1489+
and is special enough to be highlighted differently from
1490+
other built-ins)
1491+
| super
14871492
)\\b
14881493
14891494
'''

grammars/MagicPython.syntax.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ repository:
984984
| isinstance | issubclass | iter | len | license | locals | map
985985
| max | memoryview | min | next | oct | open | ord | pow | print
986986
| quit | range | reload | repr | reversed | round
987-
| setattr | sorted | sum | super | vars | zip
987+
| setattr | sorted | sum | vars | zip
988988
)\b
989989
builtin-types:
990990
name: support.type.python
@@ -994,6 +994,11 @@ repository:
994994
bool | bytearray | bytes | classmethod | complex | dict
995995
| float | frozenset | int | list | object | property
996996
| set | slice | staticmethod | str | tuple | type
997+
998+
(?# Although 'super' is not a type, it's related to types,
999+
and is special enough to be highlighted differently from
1000+
other built-ins)
1001+
| super
9971002
)\b
9981003
9991004
magic-function-names:

grammars/MagicPython.tmLanguage

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ it's not tokenized as ellipsis.
23612361
| isinstance | issubclass | iter | len | license | locals | map
23622362
| max | memoryview | min | next | oct | open | ord | pow | print
23632363
| quit | range | reload | repr | reversed | round
2364-
| setattr | sorted | sum | super | vars | zip
2364+
| setattr | sorted | sum | vars | zip
23652365
)\b
23662366
</string>
23672367
</dict>
@@ -2375,6 +2375,11 @@ it&apos;s not tokenized as ellipsis.
23752375
bool | bytearray | bytes | classmethod | complex | dict
23762376
| float | frozenset | int | list | object | property
23772377
| set | slice | staticmethod | str | tuple | type
2378+
2379+
(?# Although &apos;super&apos; is not a type, it&apos;s related to types,
2380+
and is special enough to be highlighted differently from
2381+
other built-ins)
2382+
| super
23782383
)\b
23792384
</string>
23802385
</dict>

test/expressions/expr13.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
super()
2+
3+
4+
5+
super : meta.function-call.python, source.python, support.type.python
6+
( : meta.function-call.arguments.python, meta.function-call.python, punctuation.definition.arguments.begin.python, source.python
7+
) : meta.function-call.python, punctuation.definition.arguments.end.python, source.python

0 commit comments

Comments
 (0)