Skip to content

Commit 98405c3

Browse files
committed
Improve url and yaml_value
1 parent c0117f3 commit 98405c3

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

grammars/pyresttest.cson

+28-3
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
{ 'include': '#double_quoted_string' }
179179
{ 'include': '#url' }
180180
{ 'include': '#object' }
181+
{ 'include': '#array' }
181182
]
182183
'value':
183184
'patterns': [
@@ -217,11 +218,35 @@
217218
'1':
218219
'name': 'url.parameter.key.pyresttest'
219220
'url':
220-
'match': '(?:(?:https?:\\/)|(?:\\.+))?(\\/[\\w\\.\\-\\?=\\$\\&]*)+'
221-
'name': 'markup.link.pyresttest'
221+
'patterns': [
222+
{ 'include': '#relative-url' },
223+
{ 'include': '#local-url' },
224+
{ 'include': '#remote-url' }
225+
]
226+
'relative-url':
227+
'match': '\\B[\\.\\/]+[\\/\\w\\$\\&\\-=\\?\\.]+\\b'
228+
'name': 'markup.link.relative.pyresttest'
229+
'captures':
230+
'0':
231+
'patterns': [
232+
{ 'include': '#url_parameter_key' },
233+
{ 'include': '#variable'}
234+
]
235+
'local-url':
236+
'match': '(?:https?:\\/\\/)?(?:localhost|(?:127\\.0\\.0\\.1))(?:\\:\\d{1,5})?([\\/\\w\\$\\&\\-=\\?\\.]+)'
237+
'name': 'markup.link.localhost.pyresttest'
238+
'captures':
239+
'1':
240+
'patterns': [
241+
{ 'include': '#url_parameter_key' },
242+
{ 'include': '#variable'}
243+
]
244+
'remote-url':
245+
'match': '(?:(?:https?:\\/\\/)|(?:www))(?:(?:[a-z0-9\\.\\-]+\.[a-z]{2,})|(?:\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}))(?:\\:\\d{1,5})?([\\/\\w\\$\\&\\-=\\?\\.]+)'
246+
'name': 'markup.link.remote.pyresttest'
222247
'captures':
223248
'1':
224249
'patterns': [
225-
{ 'include': '#url_parameter_key' }
250+
{ 'include': '#url_parameter_key' },
226251
{ 'include': '#variable'}
227252
]

0 commit comments

Comments
 (0)