use crate::prelude as txl;
use crate::traits::*;
use crate::*;
pub struct OptionalEquals;
impl Parsable for OptionalEquals {
fn parse_impl<S: TexlangState>(input: &mut vm::ExpandedStream<S>) -> txl::Result<Self> {
parse_optional_equals(input)?;
Ok(OptionalEquals {})
}
}
pub struct OptionalEqualsUnexpanded;
impl Parsable for OptionalEqualsUnexpanded {
fn parse_impl<S: TexlangState>(input: &mut vm::ExpandedStream<S>) -> txl::Result<Self> {
parse_optional_equals(input.unexpanded())?;
Ok(OptionalEqualsUnexpanded {})
}
}
fn parse_optional_equals<S: TexlangState, I: TokenStream<S = S>>(input: &mut I) -> txl::Result<()> {
while let Some(found_equals) = get_optional_element![
input,
token::Value::Other('=') => true,
token::Value::Space(_) => false,
] {
if found_equals {
break;
}
}
while get_optional_element![
input,
token::Value::Space(_) => (),
]
.is_some()
{}
Ok(())
}