-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathpystring.inc.syntax.yaml
More file actions
117 lines (110 loc) · 3.37 KB
/
Copy pathpystring.inc.syntax.yaml
File metadata and controls
117 lines (110 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
string-raw-quoted-${line}-line:
name: string.quoted.raw.${line}.python
begin: \b(([uU]R)|(R))(${marker})
end: (\4)${guard}
beginCaptures:
'2': {name: invalid.deprecated.prefix.python}
'3': {name: storage.type.string.python}
'4': {name: punctuation.definition.string.begin.python}
endCaptures:
'1': {name: punctuation.definition.string.end.python}
'2': {name: invalid.illegal.newline.python}
patterns:
- include: '#string-${line}-bad-brace1-formatting-raw'
- include: '#string-${line}-bad-brace2-formatting-raw'
- include: '#string-raw-guts'
string-bin-quoted-${line}-line:
name: string.quoted.binary.${line}.python
begin: (\b[bB])(${marker})
end: (\2)${guard}
beginCaptures:
'1': {name: storage.type.string.python}
'2': {name: punctuation.definition.string.begin.python}
endCaptures:
'1': {name: punctuation.definition.string.end.python}
'2': {name: invalid.illegal.newline.python}
patterns:
- include: '#string-entity'
string-raw-bin-quoted-${line}-line:
name: string.quoted.raw.binary.${line}.python
begin: (\b(?:R[bB]|[bB]R))(${marker})
end: (\2)${guard}
beginCaptures:
'1': {name: storage.type.string.python}
'2': {name: punctuation.definition.string.begin.python}
endCaptures:
'1': {name: punctuation.definition.string.end.python}
'2': {name: invalid.illegal.newline.python}
patterns:
- include: '#string-raw-bin-guts'
string-quoted-${line}-line:
name: string.quoted.${line}.python
begin: (?:\b([rR])(?=[uU]))?([uU])?(${marker})
end: (\3)${guard}
beginCaptures:
'1': {name: invalid.illegal.prefix.python}
'2': {name: storage.type.string.python}
'3': {name: punctuation.definition.string.begin.python}
endCaptures:
'1': {name: punctuation.definition.string.end.python}
'2': {name: invalid.illegal.newline.python}
patterns:
- include: '#string-${line}-bad-brace1-formatting-unicode'
- include: '#string-${line}-bad-brace2-formatting-unicode'
- include: '#string-unicode-guts'
string-${line}-bad-brace1-formatting-unicode:
comment: template using {% ... %}
begin: |
(?x)
(?= \{%
( .*? (?!${marker}${guard}) )
%\}
)
end: (?=${marker}${guard})
patterns:
- include: '#escape-sequence-unicode'
- include: '#escape-sequence'
- include: '#string-line-continuation'
string-${line}-bad-brace1-formatting-raw:
comment: template using {% ... %}
begin: |
(?x)
(?= \{%
( .*? (?!${marker}${guard}) )
%\}
)
end: (?=${marker}${guard})
patterns:
- include: '#string-consume-escape'
string-${line}-bad-brace2-formatting-unicode:
comment: odd format or format-like syntax
begin: |
(?x)
(?!\{\{)
(?= \{ (
\w*? (?!${marker}${guard}) [^!:\.\[}\w]
)
.*?(?!${marker}${guard})
\}
)
end: (?=${marker}${guard})
patterns:
- include: '#escape-sequence-unicode'
- include: '#string-entity'
string-${line}-bad-brace2-formatting-raw:
comment: odd format or format-like syntax
begin: |
(?x)
(?!\{\{)
(?= \{ (
\w*? (?!${marker}${guard}) [^!:\.\[}\w]
)
.*?(?!${marker}${guard})
\}
)
end: (?=${marker}${guard})
patterns:
- include: '#string-consume-escape'
- include: '#string-formatting'
...