From 13b0f80e4fa6fcbec86edc79efad31cd6fa2b134 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 10 Mar 2024 22:14:13 +0300 Subject: 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 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tools/emacs-pkgs/treecrumbs/treecrumbs.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools') diff --git a/tools/emacs-pkgs/treecrumbs/treecrumbs.el b/tools/emacs-pkgs/treecrumbs/treecrumbs.el index 54e2160385a0..cd49324ad747 100644 --- a/tools/emacs-pkgs/treecrumbs/treecrumbs.el +++ b/tools/emacs-pkgs/treecrumbs/treecrumbs.el @@ -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. -- cgit 1.4.1