Skip to content

Commit 38422d3

Browse files
committed
Upgrade syntaxdev to 0.1.0
1 parent 8ff35b3 commit 38422d3

9 files changed

+564
-569
lines changed

grammars/MagicPython.cson

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ repository:
894894
}
895895
]
896896
"f-expression":
897-
comment: "All valid Python expressions, except comments and line cont"
897+
comment: "All valid Python expressions, except comments and line continuation"
898898
patterns: [
899899
{
900900
include: "#expression-bare"

grammars/MagicPython.tmLanguage

+1-1
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ it's probably control flow like:
13751375
<key>f-expression</key>
13761376
<dict>
13771377
<key>comment</key>
1378-
<string>All valid Python expressions, except comments and line cont</string>
1378+
<string>All valid Python expressions, except comments and line continuation</string>
13791379
<key>patterns</key>
13801380
<array>
13811381
<dict>

grammars/src/comment.inc.syntax.yaml

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
2-
repository:
3-
comments${suffix}:
4-
name: comment.line.number-sign.python
5-
begin: (\#)
6-
beginCaptures:
7-
'1': {name: punctuation.definition.comment.python}
8-
end: ($${marker})
9-
patterns:
10-
- include: '#codetags'
2+
comments${suffix}:
3+
name: comment.line.number-sign.python
4+
begin: (\#)
5+
beginCaptures:
6+
'1': {name: punctuation.definition.comment.python}
7+
end: ($${marker})
8+
patterns:
9+
- include: '#codetags'
1110
...
+163-164
Original file line numberDiff line numberDiff line change
@@ -1,177 +1,176 @@
11
---
2-
repository:
3-
fstring-fnorm-quoted-${line}-line:
4-
name: meta.fstring.python
5-
begin: (\b[fF])([bBuU])?(${marker})
6-
end: (\3)${guard}
7-
beginCaptures:
8-
# "storage.type.string.python" class should be the first one,
9-
# because Atom, VSCode and GitHub don't understand scopes
10-
# separated by whitespace, and simply use the first one
11-
# of them. Highlighting 'f' as 'storage.type' is more
12-
# important for us than having other scopes.
13-
'1': {name: storage.type.string.python
14-
string.quoted.${line}.python
15-
string.interpolated.python}
16-
'2': {name: invalid.illegal.prefix.python}
17-
'3': {name: string.quoted.${line}.python
18-
string.interpolated.python
19-
punctuation.definition.string.begin.python}
20-
endCaptures:
21-
'1': {name: string.quoted.${line}.python
22-
string.interpolated.python
23-
punctuation.definition.string.end.python}
24-
'2': {name: invalid.illegal.newline.python}
25-
patterns:
26-
- include: '#fstring-guts'
27-
- include: '#fstring-illegal-${line}-brace'
28-
- include: '#fstring-${line}-brace'
29-
- include: '#fstring-${line}-core'
2+
fstring-fnorm-quoted-${line}-line:
3+
name: meta.fstring.python
4+
begin: (\b[fF])([bBuU])?(${marker})
5+
end: (\3)${guard}
6+
beginCaptures:
7+
# "storage.type.string.python" class should be the first one,
8+
# because Atom, VSCode and GitHub don't understand scopes
9+
# separated by whitespace, and simply use the first one
10+
# of them. Highlighting 'f' as 'storage.type' is more
11+
# important for us than having other scopes.
12+
'1': {name: storage.type.string.python
13+
string.quoted.${line}.python
14+
string.interpolated.python}
15+
'2': {name: invalid.illegal.prefix.python}
16+
'3': {name: string.quoted.${line}.python
17+
string.interpolated.python
18+
punctuation.definition.string.begin.python}
19+
endCaptures:
20+
'1': {name: string.quoted.${line}.python
21+
string.interpolated.python
22+
punctuation.definition.string.end.python}
23+
'2': {name: invalid.illegal.newline.python}
24+
patterns:
25+
- include: '#fstring-guts'
26+
- include: '#fstring-illegal-${line}-brace'
27+
- include: '#fstring-${line}-brace'
28+
- include: '#fstring-${line}-core'
3029

31-
fstring-normf-quoted-${line}-line:
32-
name: meta.fstring.python
33-
begin: (\b[bBuU])([fF])(${marker})
34-
end: (\3)${guard}
35-
beginCaptures:
36-
'1': {name: invalid.illegal.prefix.python}
37-
'2': {name: storage.type.string.python
38-
string.quoted.${line}.python
39-
string.interpolated.python}
40-
'3': {name: string.quoted.${line}.python
41-
punctuation.definition.string.begin.python}
42-
endCaptures:
43-
'1': {name: string.quoted.${line}.python
44-
string.interpolated.python
45-
punctuation.definition.string.end.python}
46-
'2': {name: invalid.illegal.newline.python}
47-
patterns:
48-
- include: '#fstring-guts'
49-
- include: '#fstring-illegal-${line}-brace'
50-
- include: '#fstring-${line}-brace'
51-
- include: '#fstring-${line}-core'
30+
fstring-normf-quoted-${line}-line:
31+
name: meta.fstring.python
32+
begin: (\b[bBuU])([fF])(${marker})
33+
end: (\3)${guard}
34+
beginCaptures:
35+
'1': {name: invalid.illegal.prefix.python}
36+
'2': {name: storage.type.string.python
37+
string.quoted.${line}.python
38+
string.interpolated.python}
39+
'3': {name: string.quoted.${line}.python
40+
punctuation.definition.string.begin.python}
41+
endCaptures:
42+
'1': {name: string.quoted.${line}.python
43+
string.interpolated.python
44+
punctuation.definition.string.end.python}
45+
'2': {name: invalid.illegal.newline.python}
46+
patterns:
47+
- include: '#fstring-guts'
48+
- include: '#fstring-illegal-${line}-brace'
49+
- include: '#fstring-${line}-brace'
50+
- include: '#fstring-${line}-core'
5251

53-
fstring-raw-quoted-${line}-line:
54-
name: meta.fstring.python
55-
begin: (\b(?:[R][fF]|[fF][R]))(${marker})
56-
end: (\2)${guard}
57-
beginCaptures:
58-
'1': {name: storage.type.string.python
59-
string.quoted.raw.${line}.python
60-
string.interpolated.python}
61-
'2': {name: string.quoted.raw.${line}.python
62-
punctuation.definition.string.begin.python}
63-
endCaptures:
64-
'1': {name: string.quoted.raw.${line}.python
65-
string.interpolated.python
66-
punctuation.definition.string.end.python}
67-
'2': {name: invalid.illegal.newline.python}
68-
patterns:
69-
- include: '#fstring-raw-guts'
70-
- include: '#fstring-illegal-${line}-brace'
71-
- include: '#fstring-${line}-brace'
72-
- include: '#fstring-raw-${line}-core'
52+
fstring-raw-quoted-${line}-line:
53+
name: meta.fstring.python
54+
begin: (\b(?:[R][fF]|[fF][R]))(${marker})
55+
end: (\2)${guard}
56+
beginCaptures:
57+
'1': {name: storage.type.string.python
58+
string.quoted.raw.${line}.python
59+
string.interpolated.python}
60+
'2': {name: string.quoted.raw.${line}.python
61+
punctuation.definition.string.begin.python}
62+
endCaptures:
63+
'1': {name: string.quoted.raw.${line}.python
64+
string.interpolated.python
65+
punctuation.definition.string.end.python}
66+
'2': {name: invalid.illegal.newline.python}
67+
patterns:
68+
- include: '#fstring-raw-guts'
69+
- include: '#fstring-illegal-${line}-brace'
70+
- include: '#fstring-${line}-brace'
71+
- include: '#fstring-raw-${line}-core'
7372

74-
fstring-${line}-core:
75-
name: string.quoted.${line}.python string.interpolated.python
76-
match: |
77-
(?x)
78-
(.+?)
79-
(
80-
(?# .* and .*? in multi-line match need special handling of
81-
newlines otherwise SublimeText and Atom will match slightly
82-
differently.
73+
fstring-${line}-core:
74+
name: string.quoted.${line}.python string.interpolated.python
75+
match: |
76+
(?x)
77+
(.+?)
78+
(
79+
(?# .* and .*? in multi-line match need special handling of
80+
newlines otherwise SublimeText and Atom will match slightly
81+
differently.
8382
84-
The guard for newlines has to be separate from the
85-
lookahead because of special $ matching rule.)
86-
($\n?)
87-
|
88-
(?=[\\\}\{]|${marker}${guard})
89-
)
90-
(?# due to how multiline regexps are matched we need a special case
91-
for matching a newline character)
92-
| \n
83+
The guard for newlines has to be separate from the
84+
lookahead because of special $ matching rule.)
85+
($\n?)
86+
|
87+
(?=[\\\}\{]|${marker}${guard})
88+
)
89+
(?# due to how multiline regexps are matched we need a special case
90+
for matching a newline character)
91+
| \n
9392
94-
fstring-raw-${line}-core:
95-
name: string.quoted.raw.${line}.python string.interpolated.python
96-
match: |
97-
(?x)
98-
(.+?)
99-
(
100-
(?# .* and .*? in multi-line match need special handling of
101-
newlines otherwise SublimeText and Atom will match slightly
102-
differently.
93+
fstring-raw-${line}-core:
94+
name: string.quoted.raw.${line}.python string.interpolated.python
95+
match: |
96+
(?x)
97+
(.+?)
98+
(
99+
(?# .* and .*? in multi-line match need special handling of
100+
newlines otherwise SublimeText and Atom will match slightly
101+
differently.
103102
104-
The guard for newlines has to be separate from the
105-
lookahead because of special $ matching rule.)
106-
($\n?)
107-
|
108-
(?=[\\\}\{]|${marker}${guard})
109-
)
110-
(?# due to how multiline regexps are matched we need a special case
111-
for matching a newline character)
112-
| \n
103+
The guard for newlines has to be separate from the
104+
lookahead because of special $ matching rule.)
105+
($\n?)
106+
|
107+
(?=[\\\}\{]|${marker}${guard})
108+
)
109+
(?# due to how multiline regexps are matched we need a special case
110+
for matching a newline character)
111+
| \n
113112
114-
fstring-${line}-brace:
115-
comment: value interpolation using { ... }
116-
begin: (\{)
117-
end: |
118-
(?x)
119-
(\})${fguard}
120-
beginCaptures:
121-
'1': {name: constant.character.format.placeholder.other.python}
122-
endCaptures:
123-
'1': {name: constant.character.format.placeholder.other.python}
124-
patterns:
125-
- include: '#fstring-terminator-${line}'
126-
- include: '#f-expression'
113+
fstring-${line}-brace:
114+
comment: value interpolation using { ... }
115+
begin: (\{)
116+
end: |
117+
(?x)
118+
(\})${fguard}
119+
beginCaptures:
120+
'1': {name: constant.character.format.placeholder.other.python}
121+
endCaptures:
122+
'1': {name: constant.character.format.placeholder.other.python}
123+
patterns:
124+
- include: '#fstring-terminator-${line}'
125+
- include: '#f-expression'
127126

128-
fstring-terminator-${line}:
129-
patterns:
130-
- name: storage.type.format.python
131-
match: (![rsa])(?=})
132-
- match: |
133-
(?x)
134-
(![rsa])?
135-
( : \w? [<>=^]? [-+ ]? \#?
136-
\d* ,? (\.\d+)? [bcdeEfFgGnosxX%]? )(?=})
137-
captures:
138-
# We use this awkward scope name instead of perhaps more
139-
# elegant "support.other.format.python" because it appears
140-
# that by default it gives a better visual result in various
141-
# systems (e.g. GitHub). This is due to the fact that
142-
# "storage.type..." is more likely to have special
143-
# highlighting in any given color scheme than
144-
# "support.other..."
145-
#
146-
'1': {name: storage.type.format.python}
147-
'2': {name: storage.type.format.python}
127+
fstring-terminator-${line}:
128+
patterns:
129+
- name: storage.type.format.python
130+
match: (![rsa])(?=})
131+
- match: |
132+
(?x)
133+
(![rsa])?
134+
( : \w? [<>=^]? [-+ ]? \#?
135+
\d* ,? (\.\d+)? [bcdeEfFgGnosxX%]? )(?=})
136+
captures:
137+
# We use this awkward scope name instead of perhaps more
138+
# elegant "support.other.format.python" because it appears
139+
# that by default it gives a better visual result in various
140+
# systems (e.g. GitHub). This is due to the fact that
141+
# "storage.type..." is more likely to have special
142+
# highlighting in any given color scheme than
143+
# "support.other..."
144+
#
145+
'1': {name: storage.type.format.python}
146+
'2': {name: storage.type.format.python}
148147
149-
- include: '#fstring-terminator-${line}-tail'
148+
- include: '#fstring-terminator-${line}-tail'
150149

151-
fstring-terminator-${line}-tail:
152-
begin: (![rsa])?(:)(?=.*?{)
153-
end: (?=})${fguard}
154-
beginCaptures:
155-
'1': {name: storage.type.format.python}
156-
'2': {name: storage.type.format.python}
150+
fstring-terminator-${line}-tail:
151+
begin: (![rsa])?(:)(?=.*?{)
152+
end: (?=})${fguard}
153+
beginCaptures:
154+
'1': {name: storage.type.format.python}
155+
'2': {name: storage.type.format.python}
157156

158-
patterns:
159-
- include: '#fstring-illegal-${line}-brace'
160-
- include: '#fstring-${line}-brace'
161-
- name: storage.type.format.python
162-
match: ([bcdeEfFgGnosxX%])(?=})
163-
- name: storage.type.format.python
164-
match: (\.\d+)
165-
- name: storage.type.format.python
166-
match: (,)
167-
- name: storage.type.format.python
168-
match: (\d+)
169-
- name: storage.type.format.python
170-
match: (\#)
171-
- name: storage.type.format.python
172-
match: ([-+ ])
173-
- name: storage.type.format.python
174-
match: ([<>=^])
175-
- name: storage.type.format.python
176-
match: (\w)
157+
patterns:
158+
- include: '#fstring-illegal-${line}-brace'
159+
- include: '#fstring-${line}-brace'
160+
- name: storage.type.format.python
161+
match: ([bcdeEfFgGnosxX%])(?=})
162+
- name: storage.type.format.python
163+
match: (\.\d+)
164+
- name: storage.type.format.python
165+
match: (,)
166+
- name: storage.type.format.python
167+
match: (\d+)
168+
- name: storage.type.format.python
169+
match: (\#)
170+
- name: storage.type.format.python
171+
match: ([-+ ])
172+
- name: storage.type.format.python
173+
match: ([<>=^])
174+
- name: storage.type.format.python
175+
match: (\w)
177176
...

0 commit comments

Comments
 (0)