fn literal(&mut self, tree: &Spanned<TokenTree>) -> Result<Spanned<AST>, Syntax> {
        let leaf = if let TokenTree::Lit(lit) = &tree.item {
            AST::Base(Base::Lit(lit.clone()))
        } else {
            return Err(Syntax::error(
                &format!("Expected a literal, found {}", &tree.item),
                &tree.span,
            ));
        };

        Ok(Spanned::new(leaf, tree.span.clone()))
    }
Constructs the AST for a literal, such as a number
or string.
passerine/src/compiler/parse.rs