isName: an identifier that is no keyword, or a contextual keyword's token.
(t: Option<&Node>, src: &str)
| 1861 | |
| 1862 | /// isName: an identifier that is no keyword, or a contextual keyword's token. |
| 1863 | fn 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(¯o_tok_text(*t, src)) |
| 1869 | } else { |
| 1870 | MACRO_ARG_CONTEXTUAL.contains(&t.kind()) |
| 1871 | } |
| 1872 | } |
| 1873 | } |
| 1874 | } |
| 1875 | |
| 1876 | /// Literal tokens (LITERALS). |
| 1877 | const MACRO_ARG_LITERALS: &[&str] = |
no test coverage detected