cygrind_utils/
lib.rs

1#![allow(dead_code)]
2
3/// Validates a `.cgp` file, returning () or the ParseError
4pub fn validate<S: AsRef<str>>(s: S) -> Result<(), parser::ParseError> {
5    parser::parse(s)?;
6    
7    Ok(())
8}
9
10#[cfg(feature = "draw2d")]
11pub mod draw2d;
12
13/// Parser for the ULTRAKILL cyber grind pattern (cgp) format
14pub mod parser;
15
16/// Utilities for drawing patterns (extracting a colour from height information)
17pub mod util;
18
19#[cfg(test)]
20mod test {
21    use crate::parser::parse;
22
23    use super::*;
24
25    #[test]
26    fn test_validate() {
27        dbg!(parse(include_str! ("../example.cgp")).unwrap().to_pattern_string());
28    }
29}