; Compose files are YAML, with the sections and service names picked out. (comment) @comment ; Top-level sections: services, volumes, networks, name, include, … (document (block_node (block_mapping (block_mapping_pair key: (flow_node) @keyword)))) ; Service, volume, network and secret names ((block_mapping_pair key: (flow_node) @_section value: (block_node (block_mapping (block_mapping_pair key: (flow_node) @identifier.type)))) (#match? @_section "^(services|volumes|networks|configs|secrets)$")) ; Everything else that is a key (block_mapping_pair key: (_) @identifier.key) (flow_pair key: (_) @identifier.key) ; Scalars ((string_scalar) @string (#not-match? @string "(?i)^(yes|no|true|false|on|off)$")) ((string_scalar) @value.boolean (#match? @value.boolean "(?i)^(yes|no|true|false|on|off)$")) (double_quote_scalar) @string (single_quote_scalar) @string (boolean_scalar) @value.boolean (integer_scalar) @value.number (float_scalar) @value.number (null_scalar) @value.null (block_scalar) @string (anchor_name) @identifier.constant (alias_name) @identifier.constant (tag) @identifier.type (escape_sequence) @string.escape [ "---" "..." "-" "?" ":" "|" ">" "*" "&" "," ] @operator [ "[" "]" "{" "}" ] @bracket