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

Function macro_is_name

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

1861
1862/// isName: an identifier that is no keyword, or a contextual keyword's token.
1863fn macro_is_name(t: Option<&Node>, src: &str) -> bool {
1864 match t {
1865 None => false,
1866 Some(t) => {
1867 if t.kind() == "identifier" {
1868 !MACRO_ARG_KEYWORDS.contains(&macro_tok_text(*t, src))
1869 } else {
1870 MACRO_ARG_CONTEXTUAL.contains(&t.kind())
1871 }
1872 }
1873 }
1874}
1875
1876/// Literal tokens (LITERALS).
1877const MACRO_ARG_LITERALS: &[&str] =

Callers 5

macro_capture_valueFunction · 0.85
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