refactor(r): remove five dead patterns from R_QUERIES

The S4/R5 contains= (single and c()), R6 inherit= (namespaced and bare)
and (comment) patterns capture @heritage*, @comment, which no code
reads: such a match has no @name and no @definition.*, so the worker
discards it. Inheritance edges come from the R scope query's
@reference.inherits.

Graph nodes, relationships, properties, resolution outcomes and the raw
worker output are byte-identical over the r-* fixtures and probe repos
before and after, so no re-analyse and no SCHEMA_BUMP are needed.

Also correct the R scope query header, which described the legacy table
as having proved the heritage shapes.
This commit is contained in:
Mick Cooney 2026-10-01 03:23:46 +01:00
parent b03684cbde
commit a7ec43dbc6
2 changed files with 4 additions and 64 deletions

View file

@ -4,9 +4,10 @@
* R has no dedicated class syntax — R6 classes are `R6Class(...)` calls, S4/R5
* classes are `setClass(...)`/`setRefClass(...)` calls — so this query mirrors
* the shapes the legacy `R_QUERIES` (`tree-sitter-queries.ts`) already proved
* queryable for structural extraction, renamed onto the scope-resolution
* capture vocabulary (`@scope.*`, `@declaration.*`, `@reference.*`,
* `@import.*`, `@type-binding.*`).
* queryable for structural extraction (the heritage shapes below have no
* counterpart there), renamed onto the scope-resolution capture vocabulary
* (`@scope.*`, `@declaration.*`, `@reference.*`, `@import.*`,
* `@type-binding.*`).
*
* R specifics encoded here:
*

View file

@ -3177,64 +3177,6 @@ export const R_QUERIES = `
(argument
value: [(identifier) (string)] @import.source))) @import
; ── Heritage: S4 contains= (single parent) ───────────────────────────────────
(call
function: (identifier) @_fn
(#match? @_fn "^(setClass|setRefClass)$")
arguments: (arguments
. (argument
value: (string
content: (string_content) @heritage.class))
(argument
name: (identifier) @_arg
(#match? @_arg "^(contains|CONTAINS)$")
value: (string
content: (string_content) @heritage.extends)))) @heritage
; ── Heritage: S4 contains= (multiple parents via c()) ────────────────────────
(call
function: (identifier) @_fn2
(#match? @_fn2 "^(setClass|setRefClass)$")
arguments: (arguments
. (argument
value: (string
content: (string_content) @heritage.class))
(argument
name: (identifier) @_arg2
(#match? @_arg2 "^(contains|CONTAINS)$")
value: (call
function: (identifier) @_cfn
(#match? @_cfn "^c$")
arguments: (arguments
(argument
value: (string
content: (string_content) @heritage.extends))))))) @heritage
; ── Heritage: R6 inherit= via namespace ──────────────────────────────────────
(binary_operator
lhs: (identifier) @heritage.class
rhs: (call
function: (namespace_operator
rhs: (identifier) @_nsfn
(#match? @_nsfn "^R6Class$"))
arguments: (arguments
(argument
name: (identifier) @_arg
(#match? @_arg "^inherit$")
value: (identifier) @heritage.extends)))) @heritage
; ── Heritage: R6 inherit= via bare call ──────────────────────────────────────
(binary_operator
lhs: (identifier) @heritage.class
rhs: (call
function: (identifier) @_r6fn
(#match? @_r6fn "^R6Class$")
arguments: (arguments
(argument
name: (identifier) @_arg
(#match? @_arg "^inherit$")
value: (identifier) @heritage.extends)))) @heritage
; ── R6 Fields via namespace (non-function entries in public/private list()) ──
(binary_operator
lhs: (identifier) @_class
@ -3286,9 +3228,6 @@ export const R_QUERIES = `
arguments: (arguments
(argument
name: (identifier) @name) @definition.property)))))
; ── Roxygen2 doc comments ────────────────────────────────────────────────────
(comment) @comment
`;
import { SupportedLanguages } from 'gitnexus-shared';