Skip to content

Commit 3aabae0

Browse files
committed
Highlight trailing semicolons as invalid.deprecated
1 parent e7b97c8 commit 3aabae0

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

Diff for: grammars/MagicPython.cson

+10
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ repository:
4545
{
4646
include: "#docstring-statement"
4747
}
48+
{
49+
include: "#semicolon"
50+
}
51+
]
52+
semicolon:
53+
patterns: [
54+
{
55+
name: "invalid.deprecated.semicolon.python"
56+
match: "\\;$"
57+
}
4858
]
4959
comments:
5060
patterns: [

Diff for: grammars/MagicPython.tmLanguage

+16
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@
6666
<key>include</key>
6767
<string>#docstring-statement</string>
6868
</dict>
69+
<dict>
70+
<key>include</key>
71+
<string>#semicolon</string>
72+
</dict>
73+
</array>
74+
</dict>
75+
<key>semicolon</key>
76+
<dict>
77+
<key>patterns</key>
78+
<array>
79+
<dict>
80+
<key>name</key>
81+
<string>invalid.deprecated.semicolon.python</string>
82+
<key>match</key>
83+
<string>\;$</string>
84+
</dict>
6985
</array>
7086
</dict>
7187
<key>comments</key>

Diff for: grammars/src/MagicPython.syntax.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ repository:
7777
- include: '#assignment-operator'
7878
- include: '#decorator'
7979
- include: '#docstring-statement'
80+
- include: '#semicolon'
81+
82+
semicolon:
83+
patterns:
84+
- name: invalid.deprecated.semicolon.python
85+
match: '\;$'
8086

8187
comments:
8288
patterns:

Diff for: misc/scopes

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ entity.name.type.class.python
2929
entity.other.inherited-class.python
3030
invalid.deprecated.backtick.python
3131
invalid.deprecated.prefix.python
32+
invalid.deprecated.semicolon.python
3233
invalid.illegal.annotation.python
3334
invalid.illegal.dec.python
3435
invalid.illegal.decorator.python

Diff for: test/semicolon/semi1.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
a;
2+
;
3+
a=1; b
4+
5+
6+
7+
a : source.python
8+
; : invalid.deprecated.semicolon.python, source.python
9+
; : invalid.deprecated.semicolon.python, source.python
10+
a : source.python
11+
= : keyword.operator.assignment.python, source.python
12+
1 : constant.numeric.dec.python, source.python
13+
; b : source.python

0 commit comments

Comments
 (0)