Skip to content

Commit eb6d0c8

Browse files
committed
Add missing scopes in grammars/src/regexp
1 parent 68c88cc commit eb6d0c8

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

grammars/MagicRegExp.cson

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ repository:
3535
include: "#regexp-base-common"
3636
}
3737
]
38+
"fstring-formatting-braces":
39+
patterns: [
40+
{
41+
comment: "empty braces are illegal"
42+
match: "({)(\\s*?)(})"
43+
captures:
44+
"1":
45+
name: "constant.character.format.placeholder.other.python"
46+
"2":
47+
name: "invalid.illegal.brace.python"
48+
"3":
49+
name: "constant.character.format.placeholder.other.python"
50+
}
51+
{
52+
name: "constant.character.escape.python"
53+
match: "({{|}})"
54+
}
55+
]
3856
"regexp-base-common":
3957
patterns: [
4058
{
@@ -410,3 +428,8 @@ repository:
410428
include: "#regexp-expression"
411429
}
412430
]
431+
codetags:
432+
match: "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)"
433+
captures:
434+
"1":
435+
name: "keyword.codetag.notation.python"

grammars/src/regexp-common.inc.syntax.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ repository:
1212
- match: \{.*?\}
1313
- include: '#regexp-base-common'
1414

15+
fstring-formatting-braces:
16+
patterns:
17+
- comment: empty braces are illegal
18+
match: ({)(\s*?)(})
19+
captures:
20+
'1': {name: constant.character.format.placeholder.other.python}
21+
'2': {name: invalid.illegal.brace.python}
22+
'3': {name: constant.character.format.placeholder.other.python}
23+
- name: constant.character.escape.python
24+
match: ({{|}})
25+
1526
regexp-base-common:
1627
patterns:
1728
- name: support.other.match.any.regexp

grammars/src/regexp.inc.syntax.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,10 @@ repository:
167167
- include: '#${prefix}${basename}-expression'
168168
${nested}
169169

170+
codetags:
171+
match: (?:\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\b)
172+
captures:
173+
'1': {name: keyword.codetag.notation.python}
174+
175+
170176
...

0 commit comments

Comments
 (0)