1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
use core::fmt::Debug;
/// A parenthesis type.
/// '(' is `OPEN` and ')' is `CLOSE`
#[derive(Debug, PartialEq)]
pub enum ParenType {
OPEN,
CLOSE
}
/// A token which may have attached data
#[derive(Debug, PartialEq)]
pub enum Tokens {
/// Elements e.g. Fe. The data is "Fe"
Element(String),
/// Numbers e.g. 13. The data is 13u16
Number(u16),
/// Parenthesis e.g. ) The data is ParenType::CLOSE
Paren(ParenType),
/// Plus sign +
Plus,
/// Yields sign ->
Yields,
}