(bin)
binary expressions like a + b or a && b
(bin operator left? right?)Where:
- operator: binary operator token (e.g.,
+,&&,===) * - left: left-hand operand *
- right: right-hand operand *
Matching:
- arithmetic operators, e.g.
a + b - logical operators, e.g.
a && b - comparison operators, e.g.
a === b
Behavior
- The operator must match exactly (e.g.,
==vs===).
Examples
Find string concatenations that build URLs from user input.
(bin + (str /https?:\/\//) (id userInput))Selects in lines { 1 } but not in { 2, 3 }:
const url1 = "https://api.example.com/" + userInput
const url2 = "https://api.example.com/" + userId
const url3 = baseUrl + userInputLocate non-strict equality checks against null.
(bin == _ (null))Selects in lines { 1 } but not in { 2, 3 }:
if (value == null) { }
if (value === null) { }
if (value == undefined) { }Find guard conditions that combine feature flags with auth checks.
(bin && (id featureEnabled) (id isAuthenticated))Selects in lines { 1 } but not in { 2, 3 }:
if (featureEnabled && isAuthenticated) { }
if (featureEnabled || isAuthenticated) { }
if (isAuthenticated && featureEnabled) { }Arguments
operator
• Identifier
Does NOT support: Composition — Free-form Selection — Refinement — Replacement
left
• (:kind) • (:ref) • (:text) • (arr) • (attr) • (bool) • (call) • (child) • (comp) • (export) • (fun) • (id) • (id+) • (import) • (jsx) • (mem) • (null) • (num) • (obj) • (of) • (prop) • (regex) • (regex+) • (str) • (str*) • (str+) • (tpl) • (tpl*) • (var) • (:into) • (:and) • (:or) • (:not) • (:replace) • (:capture)
right
• (:kind) • (:ref) • (:text) • (arr) • (attr) • (bool) • (call) • (child) • (comp) • (export) • (fun) • (id) • (id+) • (import) • (jsx) • (mem) • (null) • (num) • (obj) • (of) • (prop) • (regex) • (regex+) • (str) • (str*) • (str+) • (tpl) • (tpl*) • (var) • (:into) • (:and) • (:or) • (:not) • (:replace) • (:capture)