Languages / Perl · Edit queries/tags.scm
Tier 2 · Declarative tags.scmPerl
Declarative tree-sitter query plugin powered by QueryLanguagePlugin (rgctl-lang-runtime) and crates/rgctl-lang-perl/queries/tags.scm. Compiles once at startup, validates captures against the Tier-2 vocabulary gate, and extracts symbols, container hierarchy (Container::member), imports, and call edges.
- Grammar Crate
- ts-parser-perl
- Plugin
- QueryLanguagePlugin (rgctl-lang-perl)
- Extensions
- .pl, .pm, .t
- Discover
- rgctl discover . -l perl
- Function Kinds
- subroutine_declaration_statement, method_declaration_statement
- Class / Container Kinds
- —
Capture summary
| Capture | Patterns | Graph mapping |
|---|---|---|
| @definition.function | 2 | Emits SymbolType::Function (acts as caller scope & container). |
| @definition.module | 1 | Emits SymbolType::Module (acts as enclosing container). |
| @import.path | 2 | Emits SymbolType::Import with normalized import_path metadata. |
| @name | 6 | Symbol identifier or target callee/type name. |
| @reference.call | 3 | Emits RelationType::Calls from innermost enclosing function to @name. |
Query source (crates/rgctl-lang-perl/queries/tags.scm)
; Tier-2 Perl tags for rgctl (`handler = "queries"`).
; Grammar: ts-parser-perl (tree-sitter-perl 1.1 is ABI-incompatible with tree-sitter 0.25).
(package_statement
name: (package) @name) @definition.module
(subroutine_declaration_statement
name: (bareword) @name) @definition.function
(method_declaration_statement
name: (bareword) @name) @definition.function
(use_statement
module: (package) @import.path)
(require_expression
(bareword) @import.path)
(function_call_expression
(function) @name) @reference.call
(method_call_expression
(method) @name) @reference.call
(ambiguous_function_call_expression
(function) @name) @reference.callRelated: Tier 2 language support · Tier 1 language support · Discovering and indexing