token-parser-derive 0.3.0

Derive macros to make structs parsable into tokens
Documentation

Token Parser Derive

Derive macros for the token-parser crate. Automatically implements the Parsable trait for tuple structs.

Features

  • Parsable: Parses unnamed fields sequentially using Parsable::parse_next.
  • SymbolParsable: Parses unnamed fields (single-field recommended) using FromStr from a symbol string.

Usage

use token_parser::Parsable;
use token_parser_derive::{Parsable, SymbolParsable};

// Sequential parsing from parser
#[derive(Parsable)]
struct Point(f32, f32);

// Symbol parsing (e.g., numbers/strings)
#[derive(SymbolParsable)]
struct Token(String);