From 9e91726754299a0e7707ae19cd64af76fa7deb9a Mon Sep 17 00:00:00 2001 From: Connor Duncan Date: Fri, 17 Jan 2025 14:09:08 -0600 Subject: [PATCH] Add example of case enforcement to README --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 15e2c7df..c530e688 100644 --- a/README.md +++ b/README.md @@ -1410,6 +1410,26 @@ The example below solves the problem of indenting function application in OCaml ) ``` +### `@lower_case`/`@upper_case` +(Don't) Capitalize all of the text in the matched node. +Use this with care in languages that are case sensitive. + +```scheme +; example for SQL, since that's where this makes sense. +; I am using the grammar linked below +; https://github.com/DerekStride/tree-sitter-sql/tree/main + +; make keywords select,from lowercase. +( + [ + (keyword_select) + (keyword_from) + ] @lower_case +) +; make keyword WHERE uppercase +(keyword_where) @upper_case +``` + ### `#query_name!` When the logging verbosity is set to `-vv` or higher, Topiary outputs information about which queries are matched, for instance: