assignments.scm
1 ;; ═════════════════════════════════════════════════════════════════ 2 ;; JavaScript Variable Assignment Queries (for chain tracking) 3 ;; ═════════════════════════════════════════════════════════════════ 4 ;; These patterns capture variable-to-variable assignments that may 5 ;; form chains back to environment variables. 6 ;; 7 ;; Example chain: const env = process.env; const config = env; const x = config.VAR; 8 9 ;; ─────────────────────────────────────────────────────────────────── 10 ;; const/let/var b = a (simple chain assignment from identifier) 11 ;; ─────────────────────────────────────────────────────────────────── 12 (variable_declarator 13 name: (identifier) @assignment_target 14 value: (identifier) @assignment_source) @assignment 15 16 ;; ─────────────────────────────────────────────────────────────────── 17 ;; b = a (reassignment from identifier) 18 ;; ─────────────────────────────────────────────────────────────────── 19 (assignment_expression 20 left: (identifier) @assignment_target 21 right: (identifier) @assignment_source) @assignment