mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat: add SystemTap (#5097)
This commit is contained in:
parent
19b29f7cb0
commit
461d841771
6 changed files with 219 additions and 0 deletions
|
|
@ -506,6 +506,9 @@
|
||||||
"sxhkdrc": {
|
"sxhkdrc": {
|
||||||
"revision": "440d5f913d9465c9c776a1bd92334d32febcf065"
|
"revision": "440d5f913d9465c9c776a1bd92334d32febcf065"
|
||||||
},
|
},
|
||||||
|
"systemtap": {
|
||||||
|
"revision": "1af543a96d060b1f808982037bfc54cc02218edd"
|
||||||
|
},
|
||||||
"t32": {
|
"t32": {
|
||||||
"revision": "4e581fcd17d76651aa92759a68f9a8186b9fe8dc"
|
"revision": "4e581fcd17d76651aa92759a68f9a8186b9fe8dc"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1491,6 +1491,14 @@ list.sxhkdrc = {
|
||||||
maintainers = { "@RaafatTurki" },
|
maintainers = { "@RaafatTurki" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.systemtap = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/ok-ryoko/tree-sitter-systemtap",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@ok-ryoko" },
|
||||||
|
}
|
||||||
|
|
||||||
list.t32 = {
|
list.t32 = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://codeberg.org/xasc/tree-sitter-t32",
|
url = "https://codeberg.org/xasc/tree-sitter-t32",
|
||||||
|
|
|
||||||
18
queries/systemtap/folds.scm
Normal file
18
queries/systemtap/folds.scm
Normal file
|
|
@ -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
|
||||||
153
queries/systemtap/highlights.scm
Normal file
153
queries/systemtap/highlights.scm
Normal file
|
|
@ -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
|
||||||
2
queries/systemtap/injections.scm
Normal file
2
queries/systemtap/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
(comment) @comment
|
||||||
|
(embedded_code) @c
|
||||||
35
queries/systemtap/locals.scm
Normal file
35
queries/systemtap/locals.scm
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue