MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / macro_is_name

Function macro_is_name

codegraph-kernel/src/rustlang.rs:1837–1848  ·  view source on GitHub ↗

isName: an identifier that is no keyword, or a contextual keyword's token.

(t: Option<&Node>, src: &str)

Source from the content-addressed store, hash-verified

1835
1836/// isName: an identifier that is no keyword, or a contextual keyword's token.
1837fn macro_is_name(t: Option<&Node>, src: &str) -> bool {
1838 match t {
1839 None => false,
1840 Some(t) => {
1841 if t.kind() == "identifier" {
1842 !MACRO_ARG_KEYWORDS.contains(&macro_tok_text(*t, src))
1843 } else {
1844 MACRO_ARG_CONTEXTUAL.contains(&t.kind())
1845 }
1846 }
1847 }
1848}
1849
1850/// Literal tokens (LITERALS).
1851const MACRO_ARG_LITERALS: &[&str] =

Callers 3

macro_starts_exprFunction · 0.85
macro_is_segmentFunction · 0.85
macro_parse_chainFunction · 0.85

Calls 1

macro_tok_textFunction · 0.85

Tested by

no test coverage detected