-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathSublime Text Syntax Definition.sublime-syntax
749 lines (675 loc) · 23.9 KB
/
Sublime Text Syntax Definition.sublime-syntax
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
%YAML 1.2
---
name: Sublime Text Syntax Definition (YAML)
scope: source.yaml.sublime.syntax
version: 2
file_extensions:
- sublime-syntax
variables:
c_indicator: '[-?:,\[\]{}#&*!|>''"%@`]'
c_flow_indicator: '[\[\]{},]'
ns_plain_first_plain_out: |-
(?x:
[^\s{{c_indicator}}]
| [?:-] \S
)
_flow_scalar_end_plain_out: |-
(?x:
(?=
\s* $
| \s+ \#
| \s* : (\s|$)
)
)
_flow_scalar_end_plain_in: |-
(?x:
(?=
\s* $
| \s+ \#
| \s* : (\s|$)
| \s* : {{c_flow_indicator}}
| \s* {{c_flow_indicator}}
)
)
# based on YAML.sublime-syntax's _flow_key_out_lookahead
block_key_lookahead: |-
(?x:
(?=
(
{{ns_plain_first_plain_out}}
(
[^\s:]
| : \S
| \s+ (?![#\s])
)*
| \".*\" # simplified
| \'.*\'
)
\s*
:
(\s|$)
)
)
block_key_lookahead_bol: |-
(?x:
(?=
^ [ ]*
{{ns_plain_first_plain_out}}
(
[^\s:]
| : \S
| \s+ (?![#\s])
)*
\s*
:
(\s|$)
)
)
non_numeric_block_key_lookahead_bol: |-
(?x:
(?=
^ [ ]*
(?!\d) # exclude number matches
{{ns_plain_first_plain_out}}
(
[^\s:]
| : \S
| \s+ (?![#\s])
)*
\s*
:
(\s|$)
)
)
plain_scalar_but_not_block_key: (?={{ns_plain_first_plain_out}})(?!{{block_key_lookahead}})
contexts:
comment:
# section comment
- match: ^\s*(#+)\s*(\[)\s*([^#\]]+?)\s*(\])\s*(#+)\n?$
scope: comment.line.number-sign.yaml
captures:
1: punctuation.definition.comment.line.number-sign.yaml
2: punctuation.section.brackets.begin.sublime-syntax
3: entity.name.section.sublime-syntax
4: punctuation.section.brackets.end.sublime-syntax
5: punctuation.definition.comment.line.number-sign.yaml # may be unusual
- include: Packages/YAML/YAML.sublime-syntax#comment
main:
- match: (name)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.display-name.sublime-syntax
2: punctuation.separator.key-value.yaml
- match: (scope)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.scope-name.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_scope
- match: (version)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.version.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_int
- match: (hidden)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.modifier.hidden.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_bool
- match: (extends)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.extends.sublime-syntax
2: punctuation.separator.key-value.yaml
- match: ((?:hidden_)?file_extensions)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml entity.name.tag.yaml
2: punctuation.separator.key-value.yaml
- match: (first_line_match)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.other.first_line_match.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_regexp
- match: (variables)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.variables.sublime-syntax
2: punctuation.separator.key-value.yaml
push: variables_block
- match: (contexts)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.contexts.sublime-syntax
2: punctuation.separator.key-value.yaml
push: contexts_block
- include: comment
- include: yaml-tags-anchors
- include: scope:source.yaml
variables_block:
- meta_scope: meta.block.variables.sublime-syntax
- include: comment
- include: yaml-tags-anchors
- match: '^ +{{block_key_lookahead}}'
push: variable
- match: ^(?=\S)
pop: true
variable:
# (based on YAML.sublime-syntax#block-pair)
- match: :(?=\s|$)
scope: punctuation.separator.mapping.key-value.yaml
set: expect_regexp
# http://yaml.org/spec/1.2/spec.html#style/flow/single-quoted
# c-single-quoted(n,c)
- match: "'"
scope: punctuation.definition.string.begin.yaml
push:
- meta_scope: string.quoted.single.yaml
- meta_content_scope: entity.name.constant.sublime-syntax
- meta_include_prototype: false
- match: "''"
scope: constant.character.escape.single-quoted.yaml
- match: "'"
scope: punctuation.definition.string.end.yaml
pop: true
- include: Packages/YAML/YAML.sublime-syntax#flow-scalar-plain-out-implicit-type-12
- match: ''
push:
- meta_scope: string.unquoted.plain.out.yaml entity.name.constant.sublime-syntax
- match: '{{_flow_scalar_end_plain_out}}'
pop: true
contexts_block:
- meta_scope: meta.block.contexts.sublime-syntax
- include: comment
- include: yaml-tags-anchors
- include: context_definition
- include: context_content
- match: ^(?=\S)
pop: true
- include: scope:source.yaml
context_definition:
# (based on YAML.sublime-syntax#block-pair)
- match: ^ {1,2}{{block_key_lookahead}}
push:
- include: Packages/YAML/YAML.sublime-syntax#flow-scalar-plain-out-implicit-type-12
- match: :(?=\s|$)
scope: punctuation.separator.mapping.key-value.yaml
pop: true
- match: ''
set:
- meta_scope: string.unquoted.plain.out.yaml entity.name.function.context.sublime-syntax
- match: '{{_flow_scalar_end_plain_out}}'
pop: true
context_content:
- match: (match)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.other.match.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_regexp
- match: (escape)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.other.escape.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_regexp
- match: ((?:escape_)?captures)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.captures.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_captures
- match: ((?:embed_)?scope)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.scope-name.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_scope
- match: (include|embed)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.operator.include.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_include
- match: (branch|push|set)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.push.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_context_list
# can also be a normal context mapping (in which case the context pops)
- match: (with_prototype)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.push.sublime-syntax
2: punctuation.separator.key-value.yaml
- match: (pop)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.pop.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_bool_or_int
- match: (meta_(?:content_)?scope)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.type.scope-name.meta.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_scope
- match: ((?:meta_include|apply)_prototype)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.include-prototype.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_bool
- match: (meta_(?:append|prepend))\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml storage.modifier.context-extension.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_bool
- match: (comment)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml entity.name.tag.yaml
3: punctuation.separator.key-value.yaml
push: expect_comment
- match: (clear_scopes)\s*(:)(?=\s|$) # expects bool or number
captures:
1: string.unquoted.plain.out.yaml storage.modifier.clear-scopes.sublime-syntax
2: punctuation.separator.key-value.yaml
- match: (branch_point)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.declaration.branch-point.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_branch_point
- match: (fail)\s*(:)(?=\s|$)
captures:
1: string.unquoted.plain.out.yaml keyword.control.flow.break.sublime-syntax
2: punctuation.separator.key-value.yaml
push: expect_branch_point_reference
expect_captures:
- meta_content_scope: meta.expect-captures
- include: comment
- include: yaml-tags-anchors
- match: (\d+)\s*(:)(?=\s|$)
captures:
1: constant.numeric.integer.yaml
2: punctuation.separator.key-value.yaml
push: expect_scope
- match: '{{non_numeric_block_key_lookahead_bol}}'
pop: true
- match: (?=\S)
pop: true
expect_scope:
# ends upon EOL
- meta_content_scope: meta.expect-scope
- include: comment
- include: yaml-tags-anchors
- match: (?={{ns_plain_first_plain_out}})
set:
- meta_scope: meta.scope.sublime-syntax string.unquoted.plain.out.yaml
- match: '{{_flow_scalar_end_plain_out}}'
set:
- match: \n?
scope: meta.scope.sublime-syntax
pop: true
- match: \.
scope: punctuation.separator.scope-segments.sublime-syntax
# TODO match common scope names?
# - include: scope:source.yaml
- match: $
pop: true
- match: (?:(\|)|(>))([1-9])?([-+])?
captures:
1: keyword.control.flow.block-scalar.literal.yaml
2: keyword.control.flow.block-scalar.folded.yaml
3: constant.numeric.indentation-indicator.yaml
4: storage.modifier.chomping-indicator.yaml
set:
# We need to match the first non-empty line
# to determine the block's indentation level
# (without verifying that indentation is big enough).
- match: ^([ ]+)(?!$)
set:
- meta_scope: meta.scope.sublime-syntax string.unquoted.block.yaml
- match: ^(?!\1|\s*$)
pop: true
- match: \.
scope: punctuation.separator.scope-segments.sublime-syntax
- include: regexp
- match: ^(?=\S) # the block is empty
pop: true
- include: comment
- include: yaml-tags-anchors
- match: .+
scope: invalid.illegal.expected-comment-or-newline.yaml
expect_branch_point:
- meta_content_scope: meta.expect-branch-point
- include: comment
- include: yaml-tags-anchors
- match: (?={{ns_plain_first_plain_out}})
set:
- meta_scope: meta.branch-point.sublime-syntax
string.unquoted.plain.out.yaml
entity.name.label.branch-point.sublime-syntax
- match: '{{_flow_scalar_end_plain_out}}'
pop: true
- match: $|(?=\S)
pop: true
expect_branch_point_reference:
- meta_content_scope: meta.expect-branch-point-reference
- include: comment
- include: yaml-tags-anchors
- match: (?={{ns_plain_first_plain_out}})
set:
- meta_scope: meta.branch-point-reference.sublime-syntax
string.unquoted.plain.out.yaml
variable.other.branch-point.sublime-syntax
- match: '{{_flow_scalar_end_plain_out}}'
pop: true
- match: $|(?=\S)
pop: true
expect_include:
- meta_content_scope: meta.expect-context
- include: comment
- include: yaml-tags-anchors
- include: include
- match: $|(?=\S)
pop: true
expect_context_list:
- meta_content_scope: meta.expect-context.list
- include: comment
- include: yaml-tags-anchors
# array-like context list
- match: \[
scope: punctuation.definition.array.begin.sublime-syntax
set:
- meta_scope: meta.context-list.sublime-syntax meta.flow-sequence.yaml
- match: \]
scope: punctuation.definition.array.end.sublime-syntax
pop: true
- match: ','
scope: punctuation.separator.array-element.sublime-syntax
- include: comment
- include: yaml-tags-anchors
- include: include
# multi-line context list
- match: ^
set:
- meta_scope: meta.expect-context-list-or-content
- include: comment
- include: yaml-block-sequence
- include: include_anonymous
# first item after push/set looks like an included context
# -> maybe include, maybe incomplete key
# -> provide completions for both (context references and keys)
- match: ^([ ]+)(?=-\s*{{plain_scalar_but_not_block_key}})
set:
- meta_content_scope: meta.context-list-or-content.sublime-syntax
- include: context_list_content
# if the first line contains a context reference
# -> provide completions for context references only,
# beginning from the second line
- match: ^(?=([ ]+)-)
set:
- meta_scope: meta.context-list.sublime-syntax
- include: context_list_content
# limit context to the current line
- match: $|(?=\S)
set: expect_include
# maybe single include
- match: (?=\S)
set: expect_include
context_list_content:
- include: comment
- include: include
- include: yaml-block-sequence
- include: include_anonymous
# pop off at none-empty line with different indention than first include item
- match: ^(?!(\s*$|\1-))
pop: true
- match: \S.+$
scope: invalid.illegal.include.sublime-syntax
include_anonymous:
# a line with two (or more) hyphons after each other indicates the start
# of an anonymous context block embedded into a context list
- match: ^([ ]+)(?=- -)
push:
- clear_scopes: 1 # remove context-list... meta scopes
- meta_content_scope: meta.anonymous-context.sublime-syntax
- include: contexts_block
- match: ^(?!(\s*$|\1 +))
pop: true
include:
- match: '{{plain_scalar_but_not_block_key}}'
push:
- meta_scope: meta.include.sublime-syntax string.unquoted.plain.out.yaml
- match: '{{_flow_scalar_end_plain_in}}'
pop: true
# scope-based includes
- match: scope(:)(?=\w)
scope: support.type.include.sublime-syntax
captures:
1: punctuation.definition.scope-include.sublime-syntax
set:
- meta_content_scope: meta.include.sublime-syntax string.unquoted.plain.out.yaml
- match: '{{_flow_scalar_end_plain_in}}'
pop: true
- match: '#'
scope: punctuation.separator.context-name.sublime-syntax
set: expect_include
# absolute includes
- match: \w((?!\s#|:\s)[^{{c_flow_indicator}}])+\.sublime-syntax(?=\s*(#|$))
scope: support.module.file-path.sublime-syntax
set:
- match: '{{_flow_scalar_end_plain_in}}'
# use plain-in for when inside of a 'context-list', although not always accurate
pop: true
- match: '#'
scope: meta.include.sublime-syntax
string.unquoted.plain.out.yaml
punctuation.separator.context-name.sublime-syntax
pop: true
# local includes
- match: '[\w-]+{{_flow_scalar_end_plain_in}}' # matches until first '/' or ',' or ']'
scope: variable.other.sublime-syntax
# We don't recognize this anything else, so just match as string
- match: ''
set:
- meta_scope: string.unquoted.plain.out.yaml
- match: '{{_flow_scalar_end_plain_in}}'
pop: true
expect_bool_or_int:
- meta_content_scope: meta.expect-bool-or-int
- include: comment
- include: yaml-tags-anchors
- include: expect_bool_value
- include: expect_int_value
- match: $
pop: true
expect_bool:
- meta_content_scope: meta.expect-bool
- include: comment
- include: yaml-tags-anchors
- include: expect_bool_value
- match: $
pop: true
expect_bool_value:
- match: \b(true|false){{_flow_scalar_end_plain_out}}
scope: constant.language.boolean.yaml
pop: true
expect_int:
- meta_content_scope: meta.expect-int
- include: comment
- include: yaml-tags-anchors
- include: expect_int_value
- match: $
pop: true
expect_int_value:
- match: (?:0|[1-9][0-9_]*){{_flow_scalar_end_plain_out}}
scope: constant.numeric.integer.decimal.yaml
pop: true
expect_comment:
- meta_content_scope: meta.expect-comment
- include: comment
- include: yaml-tags-anchors
- match: '"'
scope: punctuation.definition.string.begin.yaml
push:
- meta_scope: comment.other.quoted.double.sublime-syntax
- match: \\.
scope: constant.character.escape.yaml
- match: '"'
scope: punctuation.definition.string.end.yaml
pop: true
- match: "'"
scope: punctuation.definition.string.begin.yaml
set:
- meta_scope: comment.other.quoted.single.sublime-syntax
- match: "''"
scope: constant.character.escape.yaml
- match: "'"
scope: punctuation.definition.string.end.yaml
pop: true
- match: '{{plain_scalar_but_not_block_key}}'
set:
- meta_scope: comment.other.plain.sublime-syntax
- match: '{{_flow_scalar_end_plain_out}}'
pop: true
- match: (?:(\|)|(>))([1-9])?([-+])?
captures:
1: punctuation.definition.block.scalar.literal.yaml
2: punctuation.definition.block.scalar.folded.yaml
3: constant.numeric.indentation-indicator.yaml
4: storage.modifier.chomping-indicator.yaml
set:
- match: ^([ ]+)(?!$) # match first non-empty line to determine indentation level
# note that we do not check if indentation is enough
set:
- meta_scope: comment.other.unquoted.block.sublime-syntax
- match: ^(?!\1|\s*$)
pop: true
- match: ^(?=\S) # the block is empty
pop: true
- include: comment # include comments but not properties
- match: .+
scope: invalid.illegal.expected-comment-or-newline.yaml
- match: '{{block_key_lookahead_bol}}'
pop: true
- match: (?=\S)
pop: true
expect_regexp:
- meta_content_scope: meta.expect-regexp
- include: comment
- include: yaml-tags-anchors
# Not including the regexp syntax here because of the required double-escapes.
# As such, double-quoting is discouraged.
- match: '"'
scope: punctuation.definition.string.begin.yaml
push:
- meta_scope: string.quoted.double.yaml
- meta_content_scope: source.regexp.oniguruma
- include: regexp_variable
- match: \\.
scope: constant.character.escape.yaml
- match: '"'
scope: punctuation.definition.string.end.yaml
pop: 2
- match: "'"
scope: punctuation.definition.string.begin.yaml
push:
- meta_scope: meta.string.yaml
- meta_content_scope: source.regexp.oniguruma
- match: "'(?!')"
scope: punctuation.definition.string.end.yaml
pop: 2
- match: ''
push: regexp
with_prototype:
- include: regexp_variable
- match: "''"
scope: constant.character.escape.yaml
push: regexp_quantifier_pop
- match: \\''
scope: constant.character.escape.regexp.yaml
push: regexp_quantifier_pop
- match: (?=')
pop: true
- match: '{{plain_scalar_but_not_block_key}}'
push:
- meta_scope: meta.string.yaml source.regexp.oniguruma
- match: '{{_flow_scalar_end_plain_out}}'
pop: true
- include: regexp
with_prototype:
# Variables don't work in with_protoype blocks:
# https://github.com/SublimeTextIssues/Core/issues/1488
# - match: '{{_flow_scalar_end_plain_out}}'
- match: |-
(?x:
(?=
\s* $
| \s+ \#
| \s* : (\s|$)
)
)
pop: true
- include: regexp_variable
- match: (?:(\|)|(>))([1-9])?([-+])?
captures:
1: keyword.control.flow.block-scalar.literal.yaml
2: keyword.control.flow.block-scalar.folded.yaml
3: constant.numeric.indentation-indicator.yaml
4: storage.modifier.chomping-indicator.yaml
set:
# We need to match the first non-empty line
# to determine the block's indentation level
# (without verifying that indentation is big enough).
# To be more precise, this *should* then be checked in a with_protoype,
# but due to with_prototype context overrides being compiled statically,
# backreferences are not available.
# Instead, only naively include the regexp context and hope the user
# closes his regexp groups.
#
# Because extened mode `(?x)` would push its own context,
# we match a block scalar beginning with this separately.
#
# Another option would be to pop on empty lines.
- match: ^([ ]+)(?=.*\(\?[ims]*x[ixms]*(?:-[ims]+)?\))
# This match is more accurate but doesn't match `match: ^(?x)`:
# - match: ^([ ]+)(\()(\?[ims]*x[ixms]*(?:-[ims]+)?)(\))
# captures:
# 2: keyword.control.group.regex
# 3: storage.modifier.mode.regexp
# 4: keyword.control.group.regex
set:
- meta_scope: source.regexp.oniguruma
- match: ^(?!\1|\s*$)
pop: true
- include: regexp_extended
with_prototype:
- include: regexp_variable
- match: ^([ ]+)(?!$)
set:
- meta_scope: source.regexp.oniguruma
- match: ^(?!\1|\s*$)
pop: true
- include: regexp
with_prototype:
- include: regexp_variable
- match: ^(?=\S) # the block is empty
pop: true
- include: comment
- include: yaml-tags-anchors
- match: .+
scope: invalid.illegal.expected-comment-or-newline.yaml
- match: '{{block_key_lookahead_bol}}'
pop: true
- match: '(?!{{ns_plain_first_plain_out}})[^''"\s-].*'
scope: invalid.illegal.expected-string.sublime-syntax
pop: true
- match: (?=\S)
pop: true
regexp:
- include: Oniguruma RegExp.sublime-syntax
regexp_extended:
- meta_content_scope: source.regexp.oniguruma
- include: Oniguruma RegExp.sublime-syntax#base-group-extended
regexp_variable:
- match: '(\{\{)([a-zA-Z_0-9]+)(\}\})'
scope: meta.variable.sublime-syntax keyword.other.variable.sublime-syntax
captures:
1: punctuation.definition.variable.begin.sublime-syntax
2: variable.other.sublime-syntax
3: punctuation.definition.variable.end.sublime-syntax
push: regexp_quantifier_pop
regexp_quantifier_pop:
- include: Oniguruma RegExp.sublime-syntax#quantifiers
- match: ''
pop: true
yaml-block-sequence:
- include: YAML.sublime-syntax#block-sequence
yaml-tags-anchors:
- include: YAML.sublime-syntax#property