@@ -133,6 +133,7 @@ contexts:
133133 captures :
134134 1 : string.unquoted.plain.out.yaml storage.type.extends.sublime-syntax
135135 2 : punctuation.separator.key-value.yaml
136+ push : expect_extends_list
136137
137138 - match : ((?:hidden_)?file_extensions)\s*(:)(?=\s|$)
138139 captures :
@@ -162,6 +163,52 @@ contexts:
162163
163164 - include : scope:source.yaml
164165
166+ expect_extends_list :
167+ - meta_content_scope : meta.extends.sublime-syntax
168+ - include : comment
169+ - include : yaml-tags-anchors
170+ # array-like context list
171+ - match : \[
172+ scope : punctuation.definition.array.begin.sublime-syntax
173+ set :
174+ - meta_scope : meta.extends.sublime-syntax meta.flow-sequence.yaml
175+ - match : \]
176+ scope : punctuation.definition.array.end.sublime-syntax
177+ pop : true
178+ - match : ' ,'
179+ scope : punctuation.separator.array-element.sublime-syntax
180+ - match : ' {{plain_scalar_but_not_block_key}}'
181+ push : extended_syntax_file
182+ - include : comment
183+ - include : yaml-tags-anchors
184+ # multi-line context list
185+ - match : ^([ ]+)(?=-\s*{{plain_scalar_but_not_block_key}})
186+ set :
187+ - meta_scope : meta.extends.sublime-syntax meta.block-sequence.yaml
188+ # pop off at none-empty line with different indention than first item
189+ - match : ^(?!(\s*$|\1-))
190+ pop : true
191+ - match : ' {{plain_scalar_but_not_block_key}}'
192+ push : extended_syntax_file
193+ - include : comment
194+ - include : yaml-block-sequence
195+ - match : \S.*$
196+ scope : invalid.illegal.extends.sublime-syntax
197+ # maybe single include
198+ - match : ' {{plain_scalar_but_not_block_key}}'
199+ set :
200+ - meta_scope : meta.extends.sublime-syntax meta.path.sublime-syntax string.unquoted.plain.out.yaml
201+ - include : extended_syntax_file
202+ - match : ^\s*$
203+ pop : 1
204+
205+ extended_syntax_file :
206+ - meta_scope : meta.path.sublime-syntax string.unquoted.plain.out.yaml
207+ - match : ' {{_flow_scalar_end_plain_in}}'
208+ pop : true
209+ - match : /
210+ scope : punctuation.separator.path.sublime-syntax
211+
165212 variables_block :
166213 - meta_scope : meta.block.variables.sublime-syntax
167214 - include : comment
0 commit comments