A SGF Parser for Rust. Supports all SGF properties, and tree branching.
Using pest
for the actual parsing part.
Code quality is ensured by running both cargo clippy
and cargo fmt
on each commit.
All code should also be unit tested.
```rust use sgf_parser::*;
let sgfsource = "(;EV[event]PB[black]PW[white]C[comment];B[aa])";
let tree: Result
let tree = tree.unwrap(); let unknownnodes = tree.getunknownnodes(); asserteq!(unknown_nodes.len(), 0);
let invalidnodes = tree.getinvalidnodes(); asserteq!(invalid_nodes.len(), 0);
tree.iter().foreach(|node| { assert!(!node.tokens.isempty()); });
let sgfstring: String = tree.into(); asserteq!(sgfsource, sgfstring()); ```