    try_parse(lexer, f).map(Some).or(Ok(None))
}

fn many<T, F>(lexer: &mut Lexer, f: F) -> ParseResult<Vec<T>>
    where F: Fn(&mut Lexer) -> ParseResult<T>
{
    let mut vals = Vec::new();
    while let Ok(v) = f(lexer) {
        vals.push(v);
    }
    Ok(vals)
}
