I am attempting to use the nom library to parse a FEN String. I have used an alt!
macro to combine three smaller combinators that operate on a single character. Now I would like to use use that same combinator to parse a string of characters into a vector.
I am trying to use the many1!
combinator to extract 1 or more fen_char. This is what I assumed would work, and I have tried some other variations non of which seemed to work.
named!(fen_chars<Vec<FENChar>>, many1!(fen_char));
let (_, x) = fen_chars(b"RNBQKBNR").unwrap();
assert_eq!(x.len(), 8);
assert_eq!(x[0], FENChar::Piece(Piece::Rook, Color::White));
When I run this I receive a failed option with value Incomplete(Size(1))
. I'm not certain what to make of that.