feat(treecrumbs): support for TOML

Similar to YAML, but with more weird keys and with sections.

Change-Id: I94d69d2f0e53366855ccb5d99a432c6a0361a910
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11126
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2024-03-10 22:14:13 +03:00 committed by clbot
parent 6280706ecd
commit 13b0f80e4f

View file

@ -95,6 +95,18 @@ The defined languages are stored in `treecrumbs-languages'."
("pair" . ((pair key: (string (string_content) @key))))
("array" . "[]"))
(define-treecrumbs-language toml
;; TOML has sections, key names and arrays. Sections are the only
;; relevant difference to YAML. Nested keys are not parsed, and just
;; displayed as-is.
("table" . ((table (_) @key)) )
;; TODO: query cannot match on pair in inline_table, hence matching
;; directly on keys
("pair" . ([(dotted_key)
(quoted_key)
(bare_key)]))
("array" . "[]"))
(define-treecrumbs-language cpp
;; In C++ files, crumbs are generated from namespaces and
;; identifier declarations.