pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/MagicStack/MagicPython/commit/96e41b6020737df0c63f0c7004d16439eaaded28

/> Fix highlighting for incomplete regexes like r'(' · MagicStack/MagicPython@96e41b6 · GitHub
Skip to content

Commit 96e41b6

Browse files
committed
Fix highlighting for incomplete regexes like r'('
1 parent 0d4ce85 commit 96e41b6

File tree

8 files changed

+2901
-88
lines changed

8 files changed

+2901
-88
lines changed

grammars/MagicPython.YAML-tmLanguage

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ patterns:
1111
- include: '#expression'
1212

1313
repository:
14+
$apply:
15+
- file: 'regexp-common.inc.yaml'
16+
17+
- file: 'regexp.inc.yaml'
18+
vars:
19+
prefix: 'single-one-'
20+
marker: "|(?=\\')"
21+
22+
- file: 'regexp.inc.yaml'
23+
vars:
24+
prefix: 'single-three-'
25+
marker: "|(?=\\'\\'\\')"
26+
27+
- file: 'regexp.inc.yaml'
28+
vars:
29+
prefix: 'double-one-'
30+
marker: '|(?=")'
31+
32+
- file: 'regexp.inc.yaml'
33+
vars:
34+
prefix: 'double-three-'
35+
marker: '|(?=""")'
36+
1437
comments:
1538
name: comment.line.number-sign.python
1639
match: (\#)\s*(BUG|FIXME|TODO|XXX|NB)?.*
@@ -251,7 +274,7 @@ repository:
251274
'1': {name: punctuation.definition.string.end.python}
252275
'2': {name: invalid.illegal.newline.python}
253276
patterns:
254-
- include: 'source.regexp.python'
277+
- include: '#single-one-regexp-expression'
255278

256279
regexp-double-quoted-single-line:
257280
name: string.regexp.quoted.double.python
@@ -266,7 +289,7 @@ repository:
266289
'1': {name: punctuation.definition.string.end.python}
267290
'2': {name: invalid.illegal.newline.python}
268291
patterns:
269-
- include: 'source.regexp.python'
292+
- include: '#double-one-regexp-expression'
270293

271294
regexp-single-quoted-multi-line:
272295
name: string.regexp.quoted.triple.python
@@ -280,7 +303,8 @@ repository:
280303
endCaptures:
281304
'0': {name: punctuation.definition.string.end.python}
282305
patterns:
283-
- include: '#regexp-multiline'
306+
- include: '#single-three-regexp-expression'
307+
- include: '#comments'
284308

285309
regexp-double-quoted-multi-line:
286310
name: string.regexp.quoted.triple.python
@@ -294,11 +318,7 @@ repository:
294318
endCaptures:
295319
'0': {name: punctuation.definition.string.end.python}
296320
patterns:
297-
- include: '#regexp-multiline'
298-
299-
regexp-multiline:
300-
patterns:
301-
- include: 'source.regexp.python'
321+
- include: '#double-three-regexp-expression'
302322
- include: '#comments'
303323

304324
string:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy