Function sgf_parse::parse_with_options [−][src]
pub fn parse_with_options(
text: &str,
options: &ParseOptions
) -> Result<Vec<GameTree>, SgfParseError>
Expand description
Returns the GameTree values parsed from the provided text.
Errors
If the text can’t be parsed as an SGF FF[4] collection, then an error is returned.
Examples
use sgf_parse::{parse_with_options, ParseOptions, GameType}; let sgf = "(;SZ[9]C[Some comment];B[de];W[fe])(;B[de];W[ff])"; let gametrees = parse_with_options(sgf, &ParseOptions::default()).unwrap(); assert!(gametrees.len() == 2); assert!(gametrees.iter().all(|gametree| gametree.gametype() == GameType::Go));