Skip to content

Commit 9659a5b

Browse files
committed
Don't specially highlight things like "something.Exception"
1 parent f76ec6f commit 9659a5b

File tree

5 files changed

+59
-12
lines changed

5 files changed

+59
-12
lines changed

grammars/MagicPython.cson

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ repository:
15151515
"builtin-exceptions":
15161516
name: "support.type.exception.python"
15171517
match: '''
1518-
(?x) \\b(
1518+
(?x) (?<!\\.) \\b(
15191519
(
15201520
Arithmetic | Assertion | Attribute | Buffer | BlockingIO
15211521
| BrokenPipe | ChildProcess
@@ -1546,7 +1546,7 @@ repository:
15461546
name: "support.function.builtin.python"
15471547
match: '''
15481548
(?x)
1549-
(?<!\\.)\\b(
1549+
(?<!\\.) \\b(
15501550
__import__ | abs | all | any | apply | ascii | bin | callable
15511551
| chr | compile | copyright | credits | delattr | dir | divmod
15521552
| enumerate | eval | exec | exit | filter | format | getattr
@@ -1563,7 +1563,7 @@ repository:
15631563
name: "variable.legacy.builtin.python"
15641564
match: '''
15651565
(?x)
1566-
(?<!\\.)\\b(
1566+
(?<!\\.) \\b(
15671567
file | reduce | intern | raw_input | unicode | cmp | basestring
15681568
| execfile | long | xrange
15691569
)\\b
@@ -1575,7 +1575,7 @@ repository:
15751575
name: "support.type.python"
15761576
match: '''
15771577
(?x)
1578-
(?<!\\.)\\b(
1578+
(?<!\\.) \\b(
15791579
bool | bytearray | bytes | classmethod | complex | dict
15801580
| float | frozenset | int | list | object | property
15811581
| set | slice | staticmethod | str | tuple | type

grammars/MagicPython.tmLanguage

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,7 @@ it&apos;s not tokenized as ellipsis.
24372437
<key>name</key>
24382438
<string>support.type.exception.python</string>
24392439
<key>match</key>
2440-
<string>(?x) \b(
2440+
<string>(?x) (?&lt;!\.) \b(
24412441
(
24422442
Arithmetic | Assertion | Attribute | Buffer | BlockingIO
24432443
| BrokenPipe | ChildProcess
@@ -2471,7 +2471,7 @@ it&apos;s not tokenized as ellipsis.
24712471
<string>support.function.builtin.python</string>
24722472
<key>match</key>
24732473
<string>(?x)
2474-
(?&lt;!\.)\b(
2474+
(?&lt;!\.) \b(
24752475
__import__ | abs | all | any | apply | ascii | bin | callable
24762476
| chr | compile | copyright | credits | delattr | dir | divmod
24772477
| enumerate | eval | exec | exit | filter | format | getattr
@@ -2488,7 +2488,7 @@ it&apos;s not tokenized as ellipsis.
24882488
<string>variable.legacy.builtin.python</string>
24892489
<key>match</key>
24902490
<string>(?x)
2491-
(?&lt;!\.)\b(
2491+
(?&lt;!\.) \b(
24922492
file | reduce | intern | raw_input | unicode | cmp | basestring
24932493
| execfile | long | xrange
24942494
)\b
@@ -2502,7 +2502,7 @@ it&apos;s not tokenized as ellipsis.
25022502
<string>support.type.python</string>
25032503
<key>match</key>
25042504
<string>(?x)
2505-
(?&lt;!\.)\b(
2505+
(?&lt;!\.) \b(
25062506
bool | bytearray | bytes | classmethod | complex | dict
25072507
| float | frozenset | int | list | object | property
25082508
| set | slice | staticmethod | str | tuple | type

grammars/src/MagicPython.syntax.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ repository:
10081008
builtin-exceptions:
10091009
name: support.type.exception.python
10101010
match: |
1011-
(?x) \b(
1011+
(?x) (?<!\.) \b(
10121012
(
10131013
Arithmetic | Assertion | Attribute | Buffer | BlockingIO
10141014
| BrokenPipe | ChildProcess
@@ -1037,7 +1037,7 @@ repository:
10371037
- name: support.function.builtin.python
10381038
match: |
10391039
(?x)
1040-
(?<!\.)\b(
1040+
(?<!\.) \b(
10411041
__import__ | abs | all | any | apply | ascii | bin | callable
10421042
| chr | compile | copyright | credits | delattr | dir | divmod
10431043
| enumerate | eval | exec | exit | filter | format | getattr
@@ -1051,7 +1051,7 @@ repository:
10511051
- name: variable.legacy.builtin.python
10521052
match: |
10531053
(?x)
1054-
(?<!\.)\b(
1054+
(?<!\.) \b(
10551055
file | reduce | intern | raw_input | unicode | cmp | basestring
10561056
| execfile | long | xrange
10571057
)\b
@@ -1060,7 +1060,7 @@ repository:
10601060
name: support.type.python
10611061
match: |
10621062
(?x)
1063-
(?<!\.)\b(
1063+
(?<!\.) \b(
10641064
bool | bytearray | bytes | classmethod | complex | dict
10651065
| float | frozenset | int | list | object | property
10661066
| set | slice | staticmethod | str | tuple | type

test/classes/class14.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class F(f.Exception, f.type, Exception, Exception.a, b=Exception):
2+
pass
3+
4+
5+
6+
class : meta.class.python, source.python, storage.type.class.python
7+
: meta.class.python, source.python
8+
F : entity.name.type.class.python, meta.class.python, source.python
9+
( : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.begin.python, source.python
10+
f : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python
11+
. : meta.class.inheritance.python, meta.class.python, source.python
12+
Exception : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python
13+
, : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python
14+
: meta.class.inheritance.python, meta.class.python, source.python
15+
f : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python
16+
. : meta.class.inheritance.python, meta.class.python, source.python
17+
type : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python
18+
, : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python
19+
: meta.class.inheritance.python, meta.class.python, source.python
20+
Exception : meta.class.inheritance.python, meta.class.python, source.python, support.type.exception.python
21+
, : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python
22+
: meta.class.inheritance.python, meta.class.python, source.python
23+
Exception : meta.class.inheritance.python, meta.class.python, source.python, support.type.exception.python
24+
. : meta.class.inheritance.python, meta.class.python, source.python
25+
a : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python
26+
, : meta.class.inheritance.python, meta.class.python, punctuation.separator.inheritance.python, source.python
27+
: meta.class.inheritance.python, meta.class.python, source.python
28+
b : entity.other.inherited-class.python, meta.class.inheritance.python, meta.class.python, source.python
29+
= : keyword.operator.assignment.python, meta.class.inheritance.python, meta.class.python, source.python
30+
Exception : meta.class.inheritance.python, meta.class.python, source.python, support.type.exception.python
31+
) : meta.class.inheritance.python, meta.class.python, punctuation.definition.inheritance.end.python, source.python
32+
: : meta.class.python, punctuation.section.class.begin.python, source.python
33+
: source.python
34+
pass : keyword.control.flow.python, source.python

test/expressions/expr18.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
a.Exception
2+
Exception.a
3+
4+
5+
6+
a : source.python
7+
. : source.python
8+
Exception : source.python
9+
: source.python
10+
Exception : source.python, support.type.exception.python
11+
. : source.python
12+
a : source.python
13+
: source.python

0 commit comments

Comments
 (0)