feat: add SystemTap (#5097)

This commit is contained in:
OK Ryoko 2023-07-18 19:55:06 +00:00 committed by GitHub
parent 19b29f7cb0
commit 461d841771
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 219 additions and 0 deletions

View file

@ -506,6 +506,9 @@
"sxhkdrc": {
"revision": "440d5f913d9465c9c776a1bd92334d32febcf065"
},
"systemtap": {
"revision": "1af543a96d060b1f808982037bfc54cc02218edd"
},
"t32": {
"revision": "4e581fcd17d76651aa92759a68f9a8186b9fe8dc"
},

View file

@ -1491,6 +1491,14 @@ list.sxhkdrc = {
maintainers = { "@RaafatTurki" },
}
list.systemtap = {
install_info = {
url = "https://github.com/ok-ryoko/tree-sitter-systemtap",
files = { "src/parser.c" },
},
maintainers = { "@ok-ryoko" },
}
list.t32 = {
install_info = {
url = "https://codeberg.org/xasc/tree-sitter-t32",

View 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

View 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

View file

@ -0,0 +1,2 @@
(comment) @comment
(embedded_code) @c

View 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