isName: an identifier that is no keyword, or a contextual keyword's token.
(t: Option<&Node>, src: &str)
| 1866 | |
| 1867 | /// isName: an identifier that is no keyword, or a contextual keyword's token. |
| 1868 | fn 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(¯o_tok_text(*t, src)) |
| 1874 | } else { |
| 1875 | MACRO_ARG_CONTEXTUAL.contains(&t.kind()) |
| 1876 | } |
| 1877 | } |
| 1878 | } |
| 1879 | } |
| 1880 | |
| 1881 | /// Literal tokens (LITERALS). |
| 1882 | const MACRO_ARG_LITERALS: &[&str] = |
no test coverage detected