Skip to content

Commit bd7c754

Browse files
vpetrovykh1st1
authored andcommitted
Improve semantics of the regexp scope names.
1 parent c7fc609 commit bd7c754

18 files changed

+1057
-714
lines changed

MagicRegExp.tmLanguage

Lines changed: 0 additions & 621 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ all:
66
test: release
77
# Run tests
88
./node_modules/.bin/syntaxdev test --tests test/**/*.py --syntax grammars/MagicPython.YAML-tmLanguage
9-
./node_modules/.bin/syntaxtest --tests test/**/*.regexp --syntax MagicRegExp.YAML-tmLanguage
9+
./node_modules/.bin/syntaxdev test --tests test/**/*.regexp --syntax grammars/MagicRegExp.YAML-tmLanguage
1010

1111
# Check if the version specified in "package.json" matches the latest git tag
1212
@if [ \
@@ -18,4 +18,7 @@ test: release
1818

1919
release:
2020
./node_modules/.bin/syntaxdev build-plist --in grammars/MagicPython.YAML-tmLanguage --out grammars/MagicPython.tmLanguage
21+
./node_modules/.bin/syntaxdev build-plist --in grammars/MagicRegExp.YAML-tmLanguage --out grammars/MagicRegExp.tmLanguage
22+
2123
./node_modules/.bin/syntaxdev build-cson --in grammars/MagicPython.YAML-tmLanguage --out grammars/MagicPython.cson
24+
./node_modules/.bin/syntaxdev build-cson --in grammars/MagicRegExp.YAML-tmLanguage --out grammars/MagicRegExp.cson
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ patterns:
1212
repository:
1313
expression:
1414
patterns:
15-
- name: support.type.match.any.regexp
15+
- name: support.other.match.any.regexp
1616
match: \.
17-
- name: support.type.match.begin.regexp
17+
- name: support.other.match.begin.regexp
1818
match: \^
19-
- name: support.type.match.end.regexp
19+
- name: support.other.match.end.regexp
2020
match: \$
2121
- name: keyword.operator.quantifier.regexp
2222
match: '[+*?]\??'
@@ -52,7 +52,7 @@ repository:
5252

5353
charecter-set-escapes:
5454
patterns:
55-
- name: support.type.escape.character.regexp
55+
- name: constant.character.escape.regexp
5656
match: \\[abfnrtv\\]
5757
- include: '#escape-special'
5858
- name: constant.character.escape.regexp
@@ -62,7 +62,7 @@ repository:
6262
- include: '#escape-catchall'
6363

6464
escape-special:
65-
name: support.type.escape.special.regexp
65+
name: support.other.escape.special.regexp
6666
match: \\([AbBdDsSwWZ])
6767

6868
escape-character:
@@ -88,7 +88,7 @@ repository:
8888
name: meta.backreference.regexp
8989
match: (\\[1-9]\d?)
9090
captures:
91-
'1': {name: entity.name.function.backreference.regexp}
91+
'1': {name: entity.name.tag.backreference.regexp}
9292

9393
escape-catchall:
9494
name: constant.character.escape.regexp
@@ -99,20 +99,20 @@ repository:
9999
begin: (\[)(\^)?(\])?
100100
end: (\])
101101
beginCaptures:
102-
'1': {name: constant.character.set.regexp
102+
'1': {name: constant.other.set.regexp
103103
punctuation.character.set.begin.regexp}
104104
'2': {name: keyword.operator.negation.regexp}
105105
'3': {name: constant.character.set.regexp}
106106
endCaptures:
107-
'1': {name: constant.character.set.regexp
107+
'1': {name: constant.other.set.regexp
108108
punctuation.character.set.end.regexp}
109109
patterns:
110110
- include: '#charecter-set-escapes'
111111
- name: constant.character.set.regexp
112112
match: '[^\n]'
113113

114114
flags:
115-
name: entity.name.function.flag.regexp
115+
name: storage.modifier.flag.regexp
116116
match: \(\?[aiLmsux]+\)
117117

118118
named-group:
@@ -123,11 +123,11 @@ repository:
123123
end: \)
124124
beginCaptures:
125125
'1': {name: punctuation.parenthesis.named.begin.regexp
126-
support.type.parenthesis.regexp}
127-
'2': {name: entity.name.function.named.group.regexp}
126+
support.other.parenthesis.regexp}
127+
'2': {name: entity.name.tag.named.group.regexp}
128128
endCaptures:
129129
'0': {name: punctuation.parenthesis.named.end.regexp
130-
support.type.parenthesis.regexp}
130+
support.other.parenthesis.regexp}
131131
patterns:
132132
- include: '#expression'
133133

@@ -138,10 +138,10 @@ repository:
138138
(\() (\?P= \w+(?:\s+[[:alnum:]]+)?) (\))
139139
captures:
140140
'1': {name: punctuation.parenthesis.backreference.named.begin.regexp
141-
support.type.parenthesis.regexp}
142-
'2': {name: entity.name.function.named.backreference.regexp}
141+
support.other.parenthesis.regexp}
142+
'2': {name: entity.name.tag.named.backreference.regexp}
143143
'3': {name: punctuation.parenthesis.backreference.named.end.regexp
144-
support.type.parenthesis.regexp}
144+
support.other.parenthesis.regexp}
145145

146146
comments:
147147
name: comment.regexp
@@ -217,10 +217,10 @@ repository:
217217
end: \)
218218
beginCaptures:
219219
'0': {name: punctuation.parenthesis.non-capturing.begin.regexp
220-
support.type.parenthesis.regexp}
220+
support.other.parenthesis.regexp}
221221
endCaptures:
222222
'0': {name: punctuation.parenthesis.non-capturing.end.regexp
223-
support.type.parenthesis.regexp}
223+
support.other.parenthesis.regexp}
224224
patterns:
225225
- include: '#expression'
226226

@@ -229,10 +229,10 @@ repository:
229229
end: \)
230230
beginCaptures:
231231
'0': {name: punctuation.parenthesis.begin.regexp
232-
support.type.parenthesis.regexp}
232+
support.other.parenthesis.regexp}
233233
endCaptures:
234234
'0': {name: punctuation.parenthesis.end.regexp
235-
support.type.parenthesis.regexp}
235+
support.other.parenthesis.regexp}
236236
patterns:
237237
- include: '#expression'
238238
...

0 commit comments

Comments
 (0)