diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-12 09:54:30 -0600 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 692b051b09935653befdb8f7ba8afdb640adf17b (patch) | |
| tree | 167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/tcl | |
| parent | feat(c-family): inherit injections (diff) | |
| download | nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2 nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip | |
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/tcl')
| -rw-r--r-- | runtime/queries/tcl/folds.scm | 1 | ||||
| -rw-r--r-- | runtime/queries/tcl/highlights.scm | 114 | ||||
| -rw-r--r-- | runtime/queries/tcl/indents.scm | 25 | ||||
| -rw-r--r-- | runtime/queries/tcl/injections.scm | 2 |
4 files changed, 142 insertions, 0 deletions
diff --git a/runtime/queries/tcl/folds.scm b/runtime/queries/tcl/folds.scm new file mode 100644 index 000000000..9084c662c --- /dev/null +++ b/runtime/queries/tcl/folds.scm @@ -0,0 +1 @@ +(braced_word) @fold diff --git a/runtime/queries/tcl/highlights.scm b/runtime/queries/tcl/highlights.scm new file mode 100644 index 000000000..c5f1f4c36 --- /dev/null +++ b/runtime/queries/tcl/highlights.scm @@ -0,0 +1,114 @@ +(comment) @comment @spell + +(command + name: (simple_word) @function) + +"proc" @keyword.function + +(procedure + name: (_) @variable) + +(set + (simple_word) @variable) + +(argument + name: (_) @variable.parameter) + +((simple_word) @variable.builtin + (#any-of? @variable.builtin + "argc" "argv" "argv0" "auto_path" "env" "errorCode" "errorInfo" "tcl_interactive" "tcl_library" + "tcl_nonwordchars" "tcl_patchLevel" "tcl_pkgPath" "tcl_platform" "tcl_precision" + "tcl_rcFileName" "tcl_traceCompile" "tcl_traceExec" "tcl_wordchars" "tcl_version")) + +"expr" @function.builtin + +(command + name: (simple_word) @function.builtin + (#any-of? @function.builtin + "cd" "exec" "exit" "incr" "info" "join" "puts" "regexp" "regsub" "split" "subst" "trace" + "source")) + +(command + name: (simple_word) @keyword + (#any-of? @keyword + "append" "break" "catch" "continue" "default" "dict" "error" "eval" "global" "lappend" "lassign" + "lindex" "linsert" "list" "llength" "lmap" "lrange" "lrepeat" "lreplace" "lreverse" "lsearch" + "lset" "lsort" "package" "return" "switch" "throw" "unset" "variable")) + +[ + "error" + "on" + "set" + "try" +] @keyword + +"namespace" @keyword.type + +(unpack) @operator + +[ + "while" + "foreach" +] @keyword.repeat + +[ + "if" + "else" + "elseif" +] @keyword.conditional + +[ + "**" + "/" + "*" + "%" + "+" + "-" + "<<" + ">>" + ">" + "<" + ">=" + "<=" + "==" + "!=" + "eq" + "ne" + "in" + "ni" + "&" + "^" + "|" + "&&" + "||" +] @operator + +(variable_substitution) @variable + +(quoted_word) @string + +(escaped_character) @string.escape + +[ + "{" + "}" + "[" + "]" + ";" +] @punctuation.delimiter + +((simple_word) @number + (#lua-match? @number "^[0-9]+$")) + +((simple_word) @boolean + (#any-of? @boolean "true" "false")) + +; after apply array auto_execok auto_import auto_load auto_mkindex auto_qualify +; auto_reset bgerror binary chan clock close coroutine dde encoding eof fblocked +; fconfigure fcopy file fileevent filename flush format gets glob history http +; interp load mathfunc mathop memory msgcat my next nextto open parray pid +; pkg::create pkg_mkIndex platform platform::shell pwd re_syntax read refchan +; registry rename safe scan seek self socket source string tailcall tcl::prefix +; tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord +; tcl_wordBreakAfter tcl_wordBreakBefore tcltest tell time timerate tm +; transchan unknown unload update uplevel upvar vwait yield yieldto zlib diff --git a/runtime/queries/tcl/indents.scm b/runtime/queries/tcl/indents.scm new file mode 100644 index 000000000..bc0355372 --- /dev/null +++ b/runtime/queries/tcl/indents.scm @@ -0,0 +1,25 @@ +[ + (braced_word_simple) + (namespace) + (command) + (conditional) + (foreach) + (while) + (try) + (procedure) + (command_substitution) +] @indent.begin + +(quoted_word) @indent.align + +([ + (expr) + (arguments) +] @indent.align + (#set! indent.open_delimiter "{") + (#set! indent.close_delimiter "}")) + +[ + "}" + "]" +] @indent.branch @indent.end diff --git a/runtime/queries/tcl/injections.scm b/runtime/queries/tcl/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/tcl/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
