MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / binding_names

Function binding_names

atomic-semantic/src/source.rs:311–323  ·  view source on GitHub ↗
(root: Node<'_>, source: &str, names: &mut BTreeSet<String>)

Source from the content-addressed store, hash-verified

309}
310
311fn binding_names(root: Node<'_>, source: &str, names: &mut BTreeSet<String>) {
312 let mut stack = vec![root];
313 while let Some(node) = stack.pop() {
314 if matches!(
315 node.kind(),
316 "identifier" | "shorthand_property_identifier_pattern"
317 ) {
318 names.insert(text(node, source).into());
319 } else {
320 stack.extend(children(node));
321 }
322 }
323}
324
325fn conditional(mut node: Node<'_>, source: &str) -> bool {
326 loop {

Callers 1

from_treeMethod · 0.85

Calls 4

extendMethod · 0.80
textFunction · 0.70
childrenFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected