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

Function macro_is_name

codegraph-kernel/src/rustlang.rs:1868–1879  ·  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

1866
1867/// isName: an identifier that is no keyword, or a contextual keyword's token.
1868fn macro_is_name(t: Option<&Node>, src: &str) -> bool {
1869 match t {
1870 None => false,
1871 Some(t) => {
1872 if t.kind() == "identifier" {
1873 !MACRO_ARG_KEYWORDS.contains(&macro_tok_text(*t, src))
1874 } else {
1875 MACRO_ARG_CONTEXTUAL.contains(&t.kind())
1876 }
1877 }
1878 }
1879}
1880
1881/// Literal tokens (LITERALS).
1882const 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