//! A single element
use crate Lang;
use crate;
/// A single item in a stream of tokens.
/// Formatting an item is the same as simply adding that item to the token
/// stream.
///
/// # Examples
///
/// ```
/// use genco::prelude::*;
/// use genco::tokens::{Item, ItemStr};
///
/// let foo = Item::Literal(ItemStr::Static("foo"));
/// let bar = Item::Literal(ItemStr::Box("bar".into()));
///
/// let result: Tokens = quote!($foo $bar baz);
///
/// assert_eq!("foo bar baz", result.to_string()?);
///
/// assert_eq!{
/// vec![
/// Item::Literal(ItemStr::Static("foo")),
/// Item::Space,
/// Item::Literal(ItemStr::Box("bar".into())),
/// Item::Space,
/// Item::Literal(ItemStr::Static("baz")),
/// ] as Vec<Item<()>>,
/// result,
/// };
/// # Ok::<_, genco::fmt::Error>(())
/// ```