-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAWSTemplate.sublime-syntax
95 lines (78 loc) · 2.34 KB
/
AWSTemplate.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
%YAML 1.2
---
name: AWS YAML Template
scope: source.yaml.pipeline.aws
version: 2
extends: Packages/YamlPipelines/YamlPipeline.sublime-syntax
file_extensions:
- cron.yaml
- fargate.yaml
- predeploy.yaml
first_line_match: '^AWSTemplateFormatVersion:'
variables:
variable_interpolation: |-
(?x)(?:
(\$\{)((?:AWS::)?\w+)(?:(\.)(\w+))?(\})
)
contexts:
flow-scalar-plain-out-body:
- meta_prepend: true
- include: variable-interpolation
flow-scalar-single-quoted-body:
- meta_prepend: true
- include: variable-interpolation
flow-scalar-double-quoted-body:
- meta_prepend: true
- include: variable-interpolation
variable-interpolation:
- match: '{{variable_interpolation}}'
captures:
1: punctuation.section.interpolation.begin.aws
2: variable.other.constant.aws
3: punctuation.accessor.dot.aws
4: variable.member.aws
5: punctuation.section.interpolation.end.aws
node:
- meta_prepend: true
- match: ^(\s+)(Command)\s*(:)(?=\s|$)
captures:
2: string.unquoted.plain.out.yaml keyword.control.flow.script.pipeline
3: punctuation.separator.key-value.yaml
push: script-block-sequence
script-block-sequence:
- match: |-
(?x)^(\s+)(-)[ \t]+(?="CMD-SHELL"|'CMD-SHELL'|CMD-SHELL\b)
(["'])?
(CMD-SHELL)
(["'])?
captures:
2: punctuation.definition.block.sequence.item.yaml
3: punctuation.definition.string.begin.yaml
4: variable.language.aws
5: punctuation.definition.string.end.yaml
set:
- expect-script-block-node
- pop-at-bol
- include: expect-script-block-node
pop-if-not-sequence-at-same-or-deeper-indentation:
- match: ^(?!\1\s*-)
pop: 1
pop-at-bol:
- match: ^
pop: 1
expect-script-block-node:
- match: (-)[ \t]+(?=\S)(["'])?
captures:
1: punctuation.definition.block.sequence.item.yaml
2: punctuation.definition.string.begin.yaml
push: script-block-node
- include: pop-if-not-sequence-at-same-or-deeper-indentation
script-block-node:
- meta_prepend: true
- include: flow-alias
- match: '{{_flow_scalar_end_plain_out}}'
pop: 1
embedded-bash:
- meta_include_prototype: false
- meta_scope: source.shell.bash.embedded
- include: scope:source.shell.bash.aws