-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBitbucket Pipeline.sublime-syntax
More file actions
63 lines (55 loc) · 1.84 KB
/
Bitbucket Pipeline.sublime-syntax
File metadata and controls
63 lines (55 loc) · 1.84 KB
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
%YAML 1.2
---
scope: source.yaml.pipeline.bitbucket
version: 2
extends: Packages/YamlPipelines/YamlPipeline.sublime-syntax
file_extensions:
- bitbucket-pipelines.yml
contexts:
node:
- meta_prepend: true
- match: ^\s+(name)\s*(:)\s+
captures:
1: meta.mapping.key.yaml meta.string.yaml string.unquoted.plain.out.yaml
2: punctuation.separator.key-value.yaml
push: meta-name
- match: ^(\s+)(script)\s*(:)(?=\s|$)
captures:
2: string.unquoted.plain.out.yaml keyword.control.flow.script.pipeline
3: punctuation.separator.key-value.yaml
push: script-block-sequence
meta-name:
- meta_content_scope: entity.name.label.bitbucket
- include: flow-scalar-in-12
- match: ''
pop: 1
script-block-sequence:
- meta_scope: meta.block.script.pipeline
# a list item followed by block scalar
- match: ^(\s*)(-)\s+(?=[\s|>'"])
captures:
2: punctuation.definition.block.sequence.item.yaml
embed: script-block-node
embed_scope: meta.string.yaml
escape: ^(?!\1[ ]{2}|\s*#)
# a list item with unquoted folded multi-line shell script content
- match: ^(\s*)(-)\s+
captures:
2: punctuation.definition.block.sequence.item.yaml
embed: scope:source.shell.bash.folded
embed_scope: meta.string.yaml source.shell.bash.embedded
escape: ^(?!\1[ ]{2})
# pop if not sequence at same or deeper level
- match: ^(?!\1\s*-)
pop: 1
script-block-node:
- include: script-block-scalar
- include: flow-scalar-script-out
embedded-bash:
- meta_include_prototype: false
- meta_content_scope: source.shell.bash.embedded
- include: scope:source.shell.bash
embedded-bash-folded:
- meta_include_prototype: false
- meta_content_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.folded