aboutsummaryrefslogtreecommitdiffstats
path: root/queries/systemtap
diff options
context:
space:
mode:
authorOK Ryoko <59705845+ok-ryoko@users.noreply.github.com>2023-07-18 19:55:06 +0000
committerGitHub <noreply@github.com>2023-07-18 22:55:06 +0300
commit461d841771c7a576e5fd33d1320934a4a0f1dbc9 (patch)
tree4bc914b0df7fbcaf289461a3a9024bc18754b46f /queries/systemtap
parentUpdate README (diff)
downloadnvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.tar
nvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.tar.gz
nvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.tar.bz2
nvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.tar.lz
nvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.tar.xz
nvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.tar.zst
nvim-treesitter-461d841771c7a576e5fd33d1320934a4a0f1dbc9.zip
feat: add SystemTap (#5097)
Diffstat (limited to 'queries/systemtap')
-rw-r--r--queries/systemtap/folds.scm18
-rw-r--r--queries/systemtap/highlights.scm153
-rw-r--r--queries/systemtap/injections.scm2
-rw-r--r--queries/systemtap/locals.scm35
4 files changed, 208 insertions, 0 deletions
diff --git a/queries/systemtap/folds.scm b/queries/systemtap/folds.scm
new file mode 100644
index 000000000..58bb03e51
--- /dev/null
+++ b/queries/systemtap/folds.scm
@@ -0,0 +1,18 @@
+[
+ (preprocessor_macro_definition)
+ (preprocessor_macro_expansion)
+ (conditional_preprocessing)
+ (embedded_code)
+ (probe_point_definition)
+ (probe_point_alias_prologue)
+ (probe_point_alias_epilogue)
+ (variable_declaration)
+ (function_definition)
+ (if_statement)
+ (while_statement)
+ (for_statement)
+ (foreach_statement)
+ (try_statement)
+ (catch_clause)
+ (comment)
+] @fold
diff --git a/queries/systemtap/highlights.scm b/queries/systemtap/highlights.scm
new file mode 100644
index 000000000..54a27b897
--- /dev/null
+++ b/queries/systemtap/highlights.scm
@@ -0,0 +1,153 @@
+(identifier) @variable
+
+(preprocessor_macro_definition
+ name: (identifier) @function.macro)
+
+(preprocessor_macro_expansion) @function.macro
+
+(preprocessor_constant) @constant.macro
+
+(number) @number
+(string) @string
+(escape_sequence) @string.escape
+
+[
+ (script_argument_string)
+ (script_argument_number)
+] @constant
+
+(probe_point_component) @function
+
+(function_definition
+ name: (identifier) @function)
+
+(parameter
+ name: (identifier) @parameter)
+
+(type) @type.builtin
+
+(aggregation_operator) @attribute
+
+(member_expression
+ member: (identifier) @field)
+
+(call_expression
+ function: (identifier) @function.call)
+
+((call_expression
+ function: (identifier) @function.builtin)
+ (#any-of? @function.builtin
+ "print" "printd" "printdln" "printf" "println"
+ "sprint" "sprintd" "sprintdln" "sprintf" "sprintln"))
+
+((identifier) @variable.builtin
+ (#lua-match? @variable.builtin "^\$+[0-9A-Z_a-z]+\$*$"))
+
+(shebang_line) @preproc
+
+(comment) @comment @spell
+
+[
+ "!"
+ "!="
+ "!~"
+ "$"
+ "$$"
+ "%"
+ "%="
+ "&"
+ "&&"
+ "&="
+ "*"
+ "*="
+ "+"
+ "++"
+ "+="
+ "-"
+ "--"
+ "-="
+ "->"
+ "."
+ ".="
+ "/"
+ "/="
+ ":"
+ "<"
+ "<<"
+ "<<<"
+ "<<="
+ "<="
+ "="
+ "=="
+ "=~"
+ ">"
+ ">="
+ ">>"
+ ">>="
+ "?"
+ "^"
+ "^="
+ "|"
+ "|="
+ "||"
+ "~"
+] @operator
+
+[
+ ","
+ (null_statement)
+] @punctuation.delimiter
+
+[
+ "%{"
+ "%}"
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ "delete"
+ "limit"
+ "next"
+ "probe"
+] @keyword
+
+"function" @keyword.function
+"in" @keyword.operator
+"return" @keyword.return
+
+[
+ "if"
+ "else"
+] @conditional
+
+[
+ "break"
+ "continue"
+ "for"
+ "foreach"
+ "while"
+] @repeat
+
+[
+ "try"
+ "catch"
+] @exception
+
+[
+ "%("
+ "%)"
+ "%:"
+ "%?"
+ (preprocessor_tokens)
+ (embedded_code)
+] @preproc
+
+"@define" @define
+
+"private" @type.qualifier
+"global" @storageclass
diff --git a/queries/systemtap/injections.scm b/queries/systemtap/injections.scm
new file mode 100644
index 000000000..1dd86c9f3
--- /dev/null
+++ b/queries/systemtap/injections.scm
@@ -0,0 +1,2 @@
+(comment) @comment
+(embedded_code) @c
diff --git a/queries/systemtap/locals.scm b/queries/systemtap/locals.scm
new file mode 100644
index 000000000..5d4447e52
--- /dev/null
+++ b/queries/systemtap/locals.scm
@@ -0,0 +1,35 @@
+[
+ (function_definition)
+ (statement_block)
+ (if_statement)
+ (while_statement)
+ (for_statement)
+ (foreach_statement)
+ (catch_clause)
+] @scope
+
+(init_declarator
+ name: (identifier) @definition.var)
+
+(array_declarator
+ name: (identifier) @definition.var)
+
+(function_definition
+ name: (identifier) @definition.function)
+
+(parameter
+ name: (identifier) @definition.parameter)
+
+(tuple_capture
+ (identifier) @definition.var)
+
+(catch_clause
+ parameter: (identifier) @definition.var)
+
+(assignment_expression
+ left: (identifier) @definition.var)
+
+(call_expression
+ function: (identifier) @reference)
+
+(identifier) @reference