Expand description
Parser for the list! macro.
A simple macro for constructing R lists from Rust values.
โ
// Named entries (like R's list())
list!(
alpha = 1,
beta = "hello",
gamma = vec![1, 2, 3],
)
// Unnamed entries
list!(1, "hello", vec![1, 2, 3])
// Mixed (unnamed entries get empty string names)
list!(alpha = 1, 2, beta = "hello")Re-exportsยง
use proc_macro2::TokenStream;๐use quote::quote;๐use syn::parse::Parse;๐use syn::parse::ParseStream;๐use syn::punctuated::Punctuated;๐use syn::Expr;๐use syn::Ident;๐use syn::Ident;๐use syn::LitStr;๐use syn::LitStr;๐use syn::Token;๐
Structsยง
- List
Entry - A single entry in the list.
- List
Input - Parsed
list!macro input containing zero or more entries.
Enumsยง
- List
Name - Name for a list entry โ either a Rust identifier or a string literal.
Functionsยง
- expand_
list - Expands a parsed
list!invocation into aListconstructor token stream.