pub fn parse(text: &str) -> Result<Vec<SgfNode<Prop>>, SgfParseError>
Expand description
Returns the SgfNode
values for Go games parsed from the provided text.
This is a convenience wrapper around crate::parse
for dealing with Go only collections.
§Errors
If the text can’t be parsed as an SGF FF[4] collection, then an error is returned.
§Examples
use sgf_parse::go::parse;
// Prints the all the properties for the two root nodes in the SGF
let sgf = "(;SZ[9]C[Some comment];B[de];W[fe])(;B[de];W[ff])";
for node in parse(&sgf).unwrap().iter() {
for prop in node.properties() {
println!("{:?}", prop);
}
}