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

Function literal

atomic-audit/src/extract/languages.rs:8–14  ·  view source on GitHub ↗
(node: Node<'_>)

Source from the content-addressed store, hash-verified

6use std::collections::BTreeSet;
7
8pub(super) fn literal(node: Node<'_>) -> bool {
9 let kind = node.kind();
10 (kind.contains("string") || kind.contains("char_literal") || kind == "template_string")
11 && !named(node).iter().any(|child| {
12 child.kind().contains("interpolation") || child.kind().contains("substitution")
13 })
14}
15
16pub(super) fn class_like(node: Node<'_>, language: Language) -> bool {
17 match language {

Callers 5

control_flowFunction · 0.70
modifierFunction · 0.70
leaf_tokensFunction · 0.70
code_linesFunction · 0.70
snapshot_ntriplesFunction · 0.50

Calls 4

namedFunction · 0.70
kindMethod · 0.45
containsMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected