about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/emacs-pkgs/treecrumbs/treecrumbs.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/emacs-pkgs/treecrumbs/treecrumbs.el b/tools/emacs-pkgs/treecrumbs/treecrumbs.el
index 54e2160385..cd49324ad7 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.