From 52040cc19cbdca48f91d4eb91e9b7a782bb5fbd0 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 22 Jan 2026 00:35:39 +0100 Subject: Add Rust, Go and rename examples to tests --- queries/go.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ queries/go.scm | 5 +++++ queries/rust.h | 30 ++++++++++++++++++++++++++++++ queries/rust.scm | 5 +++++ 4 files changed, 84 insertions(+) create mode 100644 queries/go.h create mode 100644 queries/go.scm create mode 100644 queries/rust.h create mode 100644 queries/rust.scm (limited to 'queries') diff --git a/queries/go.h b/queries/go.h new file mode 100644 index 0000000..c31d212 --- /dev/null +++ b/queries/go.h @@ -0,0 +1,44 @@ +unsigned char query_go[] = { + 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, + 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x66, + 0x75, 0x6e, 0x63, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, + 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, + 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x3a, 0x20, 0x28, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x40, 0x66, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x29, 0x0a, 0x28, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, + 0x70, 0x65, 0x20, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x3a, + 0x20, 0x28, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, + 0x6c, 0x69, 0x73, 0x74, 0x29, 0x20, 0x40, 0x66, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, + 0x28, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, 0x28, 0x74, 0x79, 0x70, + 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, + 0x20, 0x28, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, + 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x28, 0x73, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x29, 0x20, 0x40, 0x66, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x29, 0x29, 0x0a, 0x28, 0x74, 0x79, + 0x70, 0x65, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x20, 0x40, 0x66, + 0x74, 0x79, 0x70, 0x65, 0x20, 0x28, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, + 0x70, 0x65, 0x63, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x74, + 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, + 0x79, 0x70, 0x65, 0x3a, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x29, 0x20, 0x40, 0x66, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x29, 0x29, 0x0a, 0x28, 0x63, 0x6f, + 0x6e, 0x73, 0x74, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x22, 0x20, + 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, 0x28, 0x63, 0x6f, 0x6e, 0x73, + 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, + 0x20, 0x28, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x29, 0x0a +}; +unsigned int query_go_len = 491; diff --git a/queries/go.scm b/queries/go.scm new file mode 100644 index 0000000..c4b10db --- /dev/null +++ b/queries/go.scm @@ -0,0 +1,5 @@ +(function_declaration "func" @ftype name: (identifier) @fname parameters: (parameter_list) @fparams) +(method_declaration "func" @ftype receiver: (parameter_list) @fparams name: (field_identifier) @fname) +(type_declaration "type" @ftype (type_spec name: (type_identifier) @fname type: (struct_type) @fparams)) +(type_declaration "type" @ftype (type_spec name: (type_identifier) @fname type: (interface_type) @fparams)) +(const_declaration "const" @ftype (const_spec name: (identifier) @fname)) diff --git a/queries/rust.h b/queries/rust.h new file mode 100644 index 0000000..9bf51e8 --- /dev/null +++ b/queries/rust.h @@ -0,0 +1,30 @@ +unsigned char query_rust[] = { + 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x20, 0x22, 0x66, 0x6e, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, + 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, + 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x3a, 0x20, 0x28, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x29, 0x20, 0x40, 0x66, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x29, 0x0a, 0x28, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, + 0x69, 0x74, 0x65, 0x6d, 0x20, 0x22, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 0x3a, 0x20, 0x28, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, + 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x28, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x69, + 0x74, 0x65, 0x6d, 0x20, 0x22, 0x65, 0x6e, 0x75, 0x6d, 0x22, 0x20, 0x40, + 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, + 0x28, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, + 0x29, 0x0a, 0x28, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x5f, 0x69, 0x74, 0x65, + 0x6d, 0x20, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x22, 0x20, 0x40, 0x66, + 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, + 0x40, 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x28, 0x74, 0x72, 0x61, + 0x69, 0x74, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x22, 0x74, 0x72, 0x61, + 0x69, 0x74, 0x22, 0x20, 0x40, 0x66, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x28, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x29, 0x20, 0x40, + 0x66, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a +}; +unsigned int query_rust_len = 319; diff --git a/queries/rust.scm b/queries/rust.scm new file mode 100644 index 0000000..fecde04 --- /dev/null +++ b/queries/rust.scm @@ -0,0 +1,5 @@ +(function_item "fn" @ftype name: (identifier) @fname parameters: (parameters) @fparams) +(struct_item "struct" @ftype name: (type_identifier) @fname) +(enum_item "enum" @ftype name: (type_identifier) @fname) +(const_item "const" @ftype name: (identifier) @fname) +(trait_item "trait" @ftype name: (type_identifier) @fname) -- cgit v1.2.3